/* Products Section */

.products-section {
    padding: 80px 22px;
    max-width: 980px;
    margin: 0 auto;
    margin-top: 48px;
    min-height: 100vh;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.product-card {
    background: var(--apple-white);
    border-radius: 28px;
    overflow: hidden;
    transition: var(--transition-standard);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--apple-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.12);
    border-color: rgba(0,0,0,0.15);
}

.product-image {
    aspect-ratio: 1/1;
    background: var(--apple-off-white);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.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.08);
}

.product-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name {
    font-size: 19px;
    line-height: 1.1;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--apple-black);
}

.product-description {
    font-size: 14px;
    line-height: 1.35;
    color: var(--apple-gray);
    margin-bottom: 20px;
    /* Truncate to exactly 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 17px;
    font-weight: 500;
    color: var(--apple-black);
    margin-top: auto;
}

.product-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--apple-black);
    color: var(--apple-white);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 10;
}

/* 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.4);
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: modalOverlayIn 0.4s ease forwards;
}

.product-modal-dialog {
    position: relative;
    max-width: 980px;
    margin: 5vh auto;
    width: min(94vw, 980px);
    background: var(--apple-white);
    border-radius: 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: min(90vh, 720px);
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 40px 100px rgba(0,0,0,0.2);
    animation: modalPopupIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.product-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    color: var(--apple-black);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 10;
}

.product-modal-image-wrap {
    background: var(--apple-off-white);
    border-right: 1px solid var(--apple-border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.product-modal-main-image {
    flex: 1;
    min-height: 0;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.product-modal-image {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-modal-thumbnails {
    display: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    padding: 16px 24px;
    scrollbar-width: none;
    background: var(--apple-white);
    border-top: 1px solid var(--apple-border);
}

.product-modal-thumbnails::-webkit-scrollbar {
    display: none;
}

.product-modal-thumbnail {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-quick);
    opacity: 0.6;
}

.product-modal-thumbnail:hover {
    opacity: 1;
}

.product-modal-thumbnail.active {
    opacity: 1;
    border-color: var(--apple-black);
}

.product-modal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-modal-content {
    padding: 48px 64px 32px 48px; /* Extra right padding for close button */
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.product-modal-category {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--apple-gray);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    margin-top: -12px;
}

.product-modal-title {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 8px;
}

.product-modal-price {
    font-size: 24px;
    color: var(--apple-gray);
    margin-bottom: 24px;
}

.product-modal-details-scroll {
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 24px;
    padding-right: 8px;
}

.product-modal-details-scroll::-webkit-scrollbar {
    width: 6px;
}

.product-modal-details-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.product-modal-details-scroll::-webkit-scrollbar-thumb {
    background: var(--apple-border);
    border-radius: 6px;
}

.product-modal-description {
    font-size: 15px;
    line-height: 1.47;
    color: var(--apple-gray);
    margin-bottom: 32px;
}

.product-modal-subtitle {
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--apple-black);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.product-modal-specs {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.product-modal-specs dt {
    color: var(--apple-gray);
    font-size: 13px;
}

.product-modal-specs dd {
    font-size: 13px;
    color: var(--apple-black);
}

.product-modal-inquire-btn {
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
}



/* Filter Section */

.filter-section {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 48px;
}

.filter-btn {
    padding: 6px 14px;
    background: var(--apple-off-white);
    color: var(--apple-black);
    border: none;
    border-radius: 980px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition-quick);
}

.filter-btn:hover {
    background: #e8e8ed;
}

.filter-btn.active {
    background: var(--apple-black);
    color: var(--apple-white);
}



/* Responsive */
@media (max-width: 768px) {
    .products-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .product-modal-dialog { grid-template-columns: 1fr; height: auto; max-height: 90vh; }
    .product-inquiry { padding: 40px 20px; }
    .product-inquiry-form { grid-template-columns: 1fr; }
    .form-group:nth-child(4), .form-group:nth-child(5), .submit-btn { grid-column: span 1; }
}

/* Modal Animations */
@keyframes modalOverlayIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

@keyframes modalPopupIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
