/**
 * Shopify Integration Styles
 * Extends italist theme with dynamic product styling
 */

/* ============================================
   PRODUCT GRID
   ============================================ */

.product-grid-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-gap: 1px;
    background: #E0DCD3;
    border: 1px solid #E0DCD3;
}

@media (max-width: 1023px) {
    .product-grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .product-grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ============================================
   PRODUCT CARD
   ============================================ */

.product-card {
    align-items: center;
    background-color: #FFFFFF;
    color: inherit;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    line-height: 2em;
    padding: 15px;
    text-decoration: none;
    transition: box-shadow 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (min-width: 1024px) {
    .product-card {
        padding: 30px 32px;
    }
}

/* Trending Label */
.trending-label-container {
    visibility: hidden;
    min-height: 36px;
}

.trending-label-container[style*="visible"] {
    visibility: visible;
}

.fomo-container {
    align-items: center;
    background: #F4F1E8;
    border-radius: 10px;
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 8px 16px;
    text-align: center;
    width: fit-content;
}

.fomo-message {
    color: #2D1F1F;
    font-size: 16px;
    font-weight: bold;
    line-height: 19px;
}

@media (max-width: 1023px) {
    .fomo-message {
        font-size: 10px;
    }
    .fomo-container svg {
        width: 12px;
        height: 12px;
    }
}

/* Image Container */
.image-container {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
}

.image-container img {
    height: 330px;
    margin: 20px 0;
    width: 220px;
    object-fit: contain;
}

@media (max-width: 1023px) {
    .image-container img {
        height: 196px;
        margin: 16px 0;
        width: 131px;
    }
}

@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation: landscape) {
    .image-container img {
        height: auto;
        margin: 16px 0;
        width: 170px;
    }
}

/* Text Wrapper */
.text-wrapper {
    align-self: start;
    width: 100%;
}

.vertical-spacer {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.jsx-181079620.vertical-spacer,
.jsx-957240164.vertical-spacer {
    height: 5px;
}

@media (max-width: 1023px) {
    .jsx-181079620.vertical-spacer {
        height: 21px;
    }
}

.product-card .brand {
    font-family: 'ITC Garamond', 'Garamond', 'Baskerville', serif;
    font-size: 22px;
    line-height: 28px;
}

@media (min-width: 1024px) {
    .product-card .brand {
        font-size: 28px;
        line-height: 28px;
    }
}

.product-card .model {
    font-size: 12px;
    line-height: 18px;
    color: #666;
}

/* Price */
.price-container {
    margin-top: 10px;
}

.price-container .price {
    font-size: 14px;
    font-weight: 600;
}

.price-container .price.has-discount {
    color: #f25c5e;
}

.price-container .compare-price {
    text-decoration: line-through;
    color: #999;
    font-size: 12px;
    margin-left: 8px;
}

/* ============================================
   LOADING PLACEHOLDERS
   ============================================ */

.placeholder-card {
    background: #fff;
    padding: 15px;
}

.placeholder-card .image {
    width: 100%;
    height: 330px;
    background: #f5f5f5;
    margin-bottom: 15px;
}

@media (max-width: 1023px) {
    .placeholder-card .image {
        height: 196px;
    }
}

.placeholder-card .info > div {
    height: 16px;
    background: #f5f5f5;
    margin-bottom: 8px;
    border-radius: 4px;
}

.placeholder-card .brand {
    width: 60%;
    height: 24px !important;
}

.placeholder-card .model {
    width: 80%;
}

.placeholder-card .price {
    width: 40%;
}

/* Shimmer Animation */
.global-shimmer-animate {
    background: linear-gradient(90deg, #f5f5f5 25%, #e8e8e8 50%, #f5f5f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   FILTERS SIDEBAR
   ============================================ */

.filters-sidebar {
    width: 280px;
    padding: 20px;
    background: #fff;
    border-right: 1px solid #e5e5e5;
}

@media (max-width: 1023px) {
    .filters-sidebar {
        display: none;
    }

    .filters-sidebar.mobile-open {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        overflow-y: auto;
    }
}

.filter-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 20px;
}

.filter-section-title {
    font-family: 'Maison Neue', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-options {
    max-height: 200px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.filter-option label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.filter-option .count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

/* Sort Dropdown */
.sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sort-container label {
    font-size: 14px;
    color: #666;
}

.sort-container select {
    padding: 8px 30px 8px 12px;
    font-size: 14px;
    border: 1px solid #e5e5e5;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* ============================================
   CART PAGE
   ============================================ */

.cart-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.cart-page h1 {
    font-family: 'ITC Garamond', serif;
    font-size: 32px;
    margin-bottom: 30px;
}

.cart-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

@media (max-width: 768px) {
    .cart-container {
        grid-template-columns: 1fr;
    }
}

/* Cart Summary */
#cart-summary {
    background: #f8f8f8;
    padding: 30px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.summary-row.total {
    border-top: 1px solid #e5e5e5;
    margin-top: 15px;
    padding-top: 20px;
    font-size: 18px;
    font-weight: 600;
}

.checkout-btn {
    width: 100%;
    padding: 18px;
    background: #2d1f1f;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}

.checkout-btn:hover {
    background: #1a1212;
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ============================================
   PRODUCT DETAIL PAGE
   ============================================ */

.product-detail-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Product Gallery */
#product-gallery {
    display: flex;
    gap: 20px;
}

.product-thumbnails {
    width: 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-thumbnails img {
    width: 100%;
    height: auto;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.product-thumbnails img.active,
.product-thumbnails img:hover {
    border-color: #2d1f1f;
}

.product-main-image {
    flex: 1;
}

.product-main-image img {
    width: 100%;
    height: auto;
    max-height: 700px;
    object-fit: contain;
}

/* Product Info */
#product-info .vendor {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 10px;
}

#product-info .title {
    font-family: 'ITC Garamond', serif;
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 20px;
}

#product-info .price {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
}

#product-info .price.sale {
    color: #f25c5e;
}

#product-info .compare-price {
    text-decoration: line-through;
    color: #999;
    font-size: 18px;
    margin-left: 10px;
}

/* Size Selector */
#size-selector {
    margin: 30px 0;
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.size-option {
    min-width: 50px;
    padding: 12px 20px;
    border: 1px solid #e5e5e5;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.size-option:hover {
    border-color: #2d1f1f;
}

.size-option.selected {
    background: #2d1f1f;
    color: #fff;
    border-color: #2d1f1f;
}

.size-option.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Add to Cart Button */
#add-to-cart {
    width: 100%;
    padding: 18px;
    background: #2d1f1f;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
}

#add-to-cart:hover:not(:disabled) {
    background: #1a1212;
}

#add-to-cart:disabled {
    background: #e5e5e5;
    color: #999;
    cursor: not-allowed;
}

/* Product Description */
#product-description {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e5e5e5;
}

#product-description h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

#product-description p {
    font-size: 14px;
    line-height: 1.8;
    color: #666;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.cart-notification {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumbs {
    font-size: 12px;
    color: #666;
    padding: 15px 0;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 8px;
}

/* ============================================
   ERROR STATE
   ============================================ */

.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #fff;
}

.error-message p {
    font-size: 18px;
    color: #2d1f1f;
    margin-bottom: 20px;
}

.error-message button {
    padding: 12px 30px;
    background: #2d1f1f;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

/* ============================================
   EMPTY CART
   ============================================ */

.empty-cart {
    text-align: center;
    padding: 80px 20px;
}

.empty-cart h2 {
    font-family: 'ITC Garamond', serif;
    font-size: 28px;
    margin-top: 20px;
}

.empty-cart p {
    color: #666;
    margin-top: 10px;
}

.continue-shopping {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 40px;
    background: #2d1f1f;
    color: white;
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.continue-shopping:hover {
    background: #1a1212;
}
