/**
 * IDC Premium Cart Styles
 * Incorporates custom typography, 2-column grid, 3:5 product aspect ratio fixes.
 */

.idc-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.idc-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.idc-cart-canvas {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: #ffffff;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.idc-cart-canvas.active {
    right: 0;
}

/* ========================================
   CART PREVIEW CUSTOM STYLES (Snippet 4)
   TARGET: ONLY .idc-cart-canvas
   ======================================== */

.idc-cart-canvas,
.idc-cart-canvas *,
.idc-cart-canvas .idc-cart-header,
.idc-cart-canvas .idc-cart-close,
.idc-cart-canvas .idc-cart-item,
.idc-cart-canvas .idc-cart-item-image,
.idc-cart-canvas .idc-cart-item-image img,
.idc-cart-canvas .idc-qty-btn,
.idc-cart-canvas .idc-qty-input,
.idc-cart-canvas .idc-cart-item-remove,
.idc-cart-canvas .idc-recommendation-card,
.idc-cart-canvas .idc-recommendation-image,
.idc-cart-canvas .idc-recommendation-image img,
.idc-cart-canvas .idc-btn-add-upsell,
.idc-cart-canvas .idc-btn-checkout,
.idc-cart-canvas .idc-btn-view-cart,
.idc-cart-canvas .idc-cart-shipping-info {
    border-radius: 0 !important;
}

.idc-cart-canvas .idc-carousel-dot,
.idc-cart-canvas .idc-cart-count,
.idc-cart-canvas .spinner,
.idc-cart-canvas .loader,
.idc-cart-canvas [class*="spinner"],
.idc-cart-canvas [class*="loader"] {
    border-radius: 50% !important;
}

.idc-cart-canvas .idc-btn-view-cart {
    display: none !important;
}

/* Typography Settings */
.idc-cart-canvas,
.idc-cart-canvas * {
    font-family: 'Glacial Indifference', sans-serif !important;
    letter-spacing: 1.1px !important;
}

.idc-cart-canvas .idc-cart-title {
    font-family: 'Akira', 'Akira Light', sans-serif !important;
    font-size: 13px !important;
    font-weight: 300 !important;
    letter-spacing: 2.5px !important;
}

.idc-cart-canvas .idc-cart-count {
    font-family: Arial, sans-serif !important;
    letter-spacing: 0 !important;
    background-color: #ffffff !important;
    border: 1.5px solid #dedede !important;
    color: #000000 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    padding: 0 !important;
    margin-left: 6px !important;
    border-radius: 50% !important;
}

.idc-cart-canvas .idc-recommendations-title {
    font-family: 'Akira', 'Akira Light', sans-serif !important;
    font-size: 12px !important;
    font-weight: 300 !important;
    letter-spacing: 2.5px !important;
}

.idc-cart-canvas .idc-cart-item-name,
.idc-cart-canvas .idc-cart-item-name a {
    font-size: calc(1em - 0.5px) !important;
}

.idc-cart-canvas .woocommerce-Price-amount.amount,
.idc-cart-canvas .woocommerce-Price-amount.amount * {
    font-size: calc(1em - 0.07px) !important;
}

.idc-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #000000 !important;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.idc-cart-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #111827;
}

.idc-cart-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.idc-cart-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.idc-cart-close svg {
    width: 20px;
    height: 20px;
}

.idc-cart-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.idc-cart-body::-webkit-scrollbar {
    width: 6px;
}

.idc-cart-body::-webkit-scrollbar-track {
    background: #f9fafb;
}

.idc-cart-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* ========================================
   CART ITEMS
======================================== */

.idc-cart-items {
    padding: 0;
    margin: 0;
    list-style: none;
}

.idc-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: none !important;
    transition: background 0.2s ease;
    position: relative;
}

.idc-cart-item:hover {
    background-color: transparent !important; /* from snippet 4 */
}

.idc-cart-item-image {
    width: 113px;
    height: 153px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f3f4f6;
}

.idc-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.idc-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.idc-cart-item-name {
    font-weight: 500;
    color: #111827;
    line-height: 1.4;
    margin: 0;
}

.idc-cart-item-name a {
    color: inherit;
    text-decoration: none;
}

.idc-cart-item-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.idc-cart-item-variant {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.idc-cart-item-price {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.idc-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.idc-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    background: #ffffff;
}

.idc-qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 16px;
    transition: all 0.2s ease;
}

.idc-qty-btn:hover:not(:disabled) {
    background: #f3f4f6;
    color: #111827;
}

.idc-qty-input {
    width: 40px;
    height: 32px;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    background: transparent;
}

.idc-cart-item-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.idc-cart-item-remove:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.idc-cart-item-remove svg {
    width: 16px;
    height: 16px;
}

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

.idc-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.idc-cart-empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.idc-cart-empty-text {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 24px;
}

.idc-btn-continue {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #111827;
    color: #ffffff;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* ========================================
   SHIPPING INFO
======================================== */

.idc-cart-shipping-info {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.idc-shipping-elegant {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #5a5a5a;
    margin: 0;
    padding: 14px 24px;
    border-top: 1px solid #e5e5e5 !important;
    border-bottom: 1px solid #e5e5e5 !important;
    background: transparent !important;
}

.idc-free-shipping-progress {
    margin-top: 12px;
    padding: 16px;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    margin: 12px 24px;
}

.idc-progress-text {
    font-size: 13px;
    color: #065f46;
    margin: 0 0 8px;
    font-weight: 500;
}

.idc-progress-bar {
    width: 100%;
    height: 6px;
    background: #d1fae5;
    overflow: hidden;
}

.idc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    transition: width 0.3s ease;
}

/* ========================================
   UPSELL / CROSS-SELL SECTION (Snippet 3)
======================================== */

.idc-cart-recommendations {
    padding: 20px 16px;
}

.idc-recommendations-title {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}

.idc-recommendations-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    width: 100%;
    position: relative;
}

.idc-recommendation-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.idc-recommendation-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.idc-recommendation-image {
    width: 100%;
    padding-top: 133.33%; /* 3:4 Aspect ratio */
    position: relative;
    background: #f3f4f6;
    overflow: hidden;
}

.idc-recommendation-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.idc-recommendation-card:hover .idc-recommendation-image img {
    transform: scale(1.05);
}

.idc-recommendation-details {
    padding: 12px;
}

.idc-recommendation-name {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    margin: 0 0 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.idc-recommendation-price {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.idc-recommendation-price-current {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.idc-recommendation-price-regular {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
}

.idc-btn-add-upsell {
    width: 100%;
    padding: 8px 12px;
    background: #111827;
    color: #ffffff;
    border: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.idc-btn-add-upsell:hover {
    transform: translateY(-1px);
    background: #1f2937;
}

.idc-btn-add-upsell:active {
    transform: translateY(0);
}

.idc-btn-add-upsell svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    .idc-recommendations-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 480px) {
    .idc-recommendations-grid {
        gap: 8px !important;
    }
    .idc-recommendation-name {
        font-size: 12px;
    }
    .idc-btn-add-upsell {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 360px) {
    .idc-recommendations-grid {
        gap: 6px !important;
    }
}

/* ========================================
   FOOTER / TOTALS
======================================== */

.idc-cart-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 16px 20px;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
}

.idc-cart-totals {
    margin-bottom: 20px;
}

.idc-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.idc-total-row.subtotal {
    color: #6b7280;
}

.idc-total-row.discount {
    color: #10b981;
    font-weight: 500;
}

.idc-total-row.total {
    padding-top: 16px;
    margin-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.idc-btn-checkout {
    padding: 10px 24px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase;
    line-height: 1.4 !important;
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #000000 !important;
    transition: all 0.3s ease !important;
    width: 100%;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.idc-btn-checkout:hover {
    background-color: #333333 !important;
    border-color: #333333 !important;
}

/* ========================================
   Quick View Z-Index Fix (Snippet 3)
======================================== */
.mfp-bg.mfp-ready,
.mfp-wrap.mfp-ready {
    z-index: 1000002 !important;
}

@media (max-width: 768px) {
    .mfp-wrap .quick-view-popup.et-quick-view-wrapper {
        width: 95% !important;
        max-width: 500px !important;
        margin: 20px auto !important;
    }
}

/* ========================================
   Product Grid - 3:5 Aspect Ratio Fix (Snippet 6)
======================================== */
.etheme-product-grid-image {
    position: relative;
    width: 100%;
    padding-top: 166.67%; /* 3:5 ratio */
    overflow: hidden;
    background-color: #f5f5f5;
}

.etheme-product-grid-image > a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.etheme-product-grid-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.etheme-product-grid-image .sale-wrapper,
.etheme-product-grid-image footer {
    position: absolute;
    z-index: 10;
}

.etheme-product-grid-image footer {
    bottom: 0;
    left: 0;
    right: 0;
}

.sale-wrapper {
    top: 10px;
    left: 10px;
}

@media (max-width: 768px) {
    .etheme-product-grid-image {
        padding-top: 166.67%;
    }
}

/* Font Fallbacks */
@font-face {
    font-family: 'Akira';
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Glacial Indifference';
    font-style: normal;
    font-display: swap;
}
