/* Products Section */

.products-section {
    padding: 6rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    margin-top: 100px;
    min-height: 100vh;
}

.products-section .section-title {
    text-align: center;
    display: block;
    width: 100%;
}

.products-section .section-title::after {
    left: 50%;
    transform: translateX(-50%) scaleX(1);
}

.products-section .section-subtitle {
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 3rem;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid rgba(212, 175, 55, 0.2);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    transform: translateY(30px);
}

.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.25);
    border-color: rgba(212, 175, 55, 0.4);
}

.product-card:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 3px;
}

.product-image {
    height: 210px;
    background: var(--secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    overflow: hidden;
    position: relative;
}

.product-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card:hover .product-image::before {
    opacity: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-image span {
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-gold);
    line-height: 1.25;
    min-height: 2.75em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.45;
    min-height: 2.9em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-light);
    font-family: 'Times New Roman', serif;
    margin-top: auto;
}

.product-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-gold);
    color: var(--dark-bg);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Product Details Modal */

.product-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
}

.product-modal.open {
    display: block;
}

.product-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    animation: modalOverlayIn 0.24s ease forwards;
}

.product-modal-dialog {
    position: relative;
    max-width: 980px;
    margin: 5vh auto;
    width: min(94vw, 980px);
    max-height: 90vh;
    background: var(--card-bg);
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr);
    align-items: stretch;
    height: min(90vh, 820px);
    overflow: hidden;
    z-index: 1;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    animation: modalPopupIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.product-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: rgba(0, 0, 0, 0.45);
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.7rem;
    line-height: 1;
}

.product-modal-image-wrap {
    background: var(--secondary-bg);
    min-height: 0;
    height: 100%;
    border-right: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    flex-direction: column;
}

.product-modal-main-image {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-modal-image-fallback {
    width: 100%;
    height: 100%;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.product-modal-thumbnails {
    display: none;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    background: rgba(0, 0, 0, 0.3);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.5) transparent;
}

.product-modal-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.product-modal-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.product-modal-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 2px;
}

.product-modal-thumbnail {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 2px solid rgba(212, 175, 55, 0.3);
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.product-modal-thumbnail:hover {
    border-color: rgba(212, 175, 55, 0.7);
    opacity: 0.9;
}

.product-modal-thumbnail.active {
    border-color: var(--primary-gold);
    opacity: 1;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.product-modal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-content {
    padding: 2rem;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.product-modal-category {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.product-modal-title {
    color: var(--primary-gold);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.product-modal-price {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 0.8rem;
}

.product-modal-description {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.product-modal-details-scroll {
    overflow-y: auto;
    min-height: 0;
    padding-right: 0.35rem;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.75) rgba(255, 255, 255, 0.06);
}

.product-modal-details-scroll::-webkit-scrollbar {
    width: 8px;
}

.product-modal-details-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

.product-modal-details-scroll::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.75);
    border-radius: 8px;
}

.product-modal-details-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.95);
}

.product-modal-subtitle {
    color: var(--primary-gold);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.product-modal-specs {
    display: grid;
    grid-template-columns: minmax(110px, 160px) 1fr;
    row-gap: 0.5rem;
    column-gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.product-modal-specs dt {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.product-modal-specs dd {
    margin: 0;
    color: var(--text-light);
    word-break: break-word;
    font-size: 0.95rem;
}

.product-modal-inquire-btn {
    width: 100%;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--primary-gold);
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.15);
}

@keyframes modalPopupIn {
    from {
        transform: translateY(16px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes modalOverlayIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* Product Inquiry */

.product-inquiry {
    margin-top: 4rem;
    background: var(--card-bg);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-inquiry.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-inquiry h3 {
    font-size: 1.8rem;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}

.product-inquiry-form input,
.product-inquiry-form select,
.product-inquiry-form textarea {
    background: var(--secondary-bg);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-light);
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.product-inquiry-form input:focus,
.product-inquiry-form select:focus,
.product-inquiry-form textarea:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

.inquiry-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.product-inquiry-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.product-inquiry-form .form-group {
    display: flex;
    flex-direction: column;
}

.product-inquiry-form .form-group:nth-child(5) {
    grid-column: 1 / -1;
}

.product-inquiry-form label {
    color: var(--text-light);
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.product-inquiry-form input,
.product-inquiry-form select,
.product-inquiry-form textarea {
    background: var(--secondary-bg);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-light);
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
}

.product-inquiry-form textarea {
    min-height: 120px;
    resize: vertical;
}

.product-inquiry-form input:focus,
.product-inquiry-form select:focus,
.product-inquiry-form textarea:focus {
    outline: none;
    border-color: var(--primary-gold);
}

.submit-btn {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 0.8rem 1.6rem;
    background: var(--primary-gold);
    color: var(--dark-bg);
    border: 1px solid var(--primary-gold);
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: transparent;
    color: var(--primary-gold);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-message {
    grid-column: 1 / -1;
    display: none;
    padding: 0.75rem 0.9rem;
    border: 1px solid transparent;
}

.form-message.success {
    display: block;
    color: #8ce08c;
    border-color: rgba(140, 224, 140, 0.35);
    background: rgba(140, 224, 140, 0.08);
}

.form-message.error {
    display: block;
    color: #ff9f9f;
    border-color: rgba(255, 159, 159, 0.35);
    background: rgba(255, 159, 159, 0.08);
}


/* Filter Section */

.filter-section {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-section::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(212, 175, 55, 0.3);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.9rem;
    flex: 0 0 auto;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    transition: left 0.5s ease;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-gold);
    color: var(--dark-bg);
    border-color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
}

.filter-btn:active {
    transform: translateY(0) scale(0.98);
}


/* Responsive */

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .products-section {
        margin-top: 86px;
        padding: 4rem 1rem;
    }
    .products-grid {
        gap: 0.9rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .filter-section {
        justify-content: flex-start;
        gap: 0.6rem;
        margin-bottom: 2rem;
        padding-bottom: 0.25rem;
    }
    .filter-btn {
        width: auto;
        text-align: left;
    }
    .product-inquiry-form {
        grid-template-columns: 1fr;
    }
    .product-inquiry {
        padding: 1.25rem;
    }
    .product-info {
        padding: 0.85rem;
    }
    .product-image {
        height: 160px;
    }
    .submit-btn {
        width: 100%;
    }
    .product-modal-dialog {
        margin: 2vh auto;
        width: min(96vw, 980px);
        max-height: 96vh;
        height: 96vh;
        display: flex;
        flex-direction: column;
    }
    .product-modal-image-wrap {
        min-height: 220px;
        height: 220px;
        flex: 0 0 220px;
        border-right: 0;
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
        overflow: hidden;
    }
    .product-modal-main-image {
        min-height: 0;
        flex: 1;
    }
    .product-modal-image-fallback {
        min-height: 0;
        height: 100%;
    }
    .product-modal-thumbnails {
        padding: 0.5rem;
        gap: 0.4rem;
    }
    .product-modal-thumbnail {
        width: 50px;
        height: 50px;
    }
    .product-modal-title {
        font-size: 1.25rem;
        line-height: 1.25;
    }
    .product-modal-price {
        font-size: 1.2rem;
        line-height: 1.35;
        word-break: break-word;
    }
    .product-modal-content {
        padding: 1.25rem;
        flex: 1 1 auto;
        min-height: 0;
    }
    .product-modal-specs {
        grid-template-columns: 1fr;
        row-gap: 0.2rem;
    }
    .product-modal-specs dt {
        margin-top: 0.5rem;
    }
}
