/**
 * Idayat Premium Cart - Modern & Elegant Styles
 * Inspired by luxury fashion e-commerce design
 */

/* ========================================
   CART OVERLAY & CONTAINER
======================================== */

.idayat-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);
}

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

.idayat-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);
}

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

/* ========================================
   HEADER
======================================== */

.idayat-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.idayat-cart-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.02em;
}

.idayat-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #111827;
    color: #ffffff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

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

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

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

/* ========================================
   BODY / SCROLLABLE AREA
======================================== */

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

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

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

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

.idayat-cart-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

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

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

.idayat-cart-item {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
    position: relative;
}

.idayat-cart-item:hover {
    background: #f9fafb;
}

.idayat-cart-item-image {
    width: 100px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}

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

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

.idayat-cart-item-name {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    line-height: 1.4;
    margin: 0;
    letter-spacing: -0.01em;
}

.idayat-cart-item-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.idayat-cart-item-name a:hover {
    color: #6b7280;
}

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

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

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

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

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

.idayat-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;
}

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

.idayat-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.idayat-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;
}

.idayat-qty-input:focus {
    outline: none;
}

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

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

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

/* Pre-order badge */
.idayat-cart-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

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

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

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

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

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

.idayat-btn-continue:hover {
    background: #1f2937;
    transform: translateY(-1px);
}

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

.idayat-cart-shipping-info {
    padding: 20px 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.idayat-shipping-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.idayat-shipping-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #10b981;
    margin-top: 2px;
}

.idayat-shipping-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    margin: 0;
}

.idayat-shipping-text strong {
    color: #111827;
    font-weight: 600;
}

/* Free shipping progress bar */
.idayat-free-shipping-progress {
    margin-top: 12px;
    padding: 16px;
    background: #ecfdf5;
    border-radius: 8px;
    border: 1px solid #d1fae5;
}

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

.idayat-progress-bar {
    width: 100%;
    height: 6px;
    background: #d1fae5;
    border-radius: 3px;
    overflow: hidden;
}

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

/* ========================================
   UPSELL / CROSS-SELL SECTION
======================================== */

.idayat-cart-recommendations {
    padding: 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.idayat-recommendations-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}

.idayat-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.idayat-recommendation-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.idayat-recommendation-image {
    width: 100%;
    height: 140px;
    background: #f3f4f6;
    overflow: hidden;
}

.idayat-recommendation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

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

.idayat-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;
}

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

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

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

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

.idayat-btn-add-upsell:hover {
    background: #1f2937;
}

.idayat-btn-add-upsell.added {
    background: #10b981;
    pointer-events: none;
}

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

/* ========================================
   COUPON SECTION - WooCommerce Blocks Style
======================================== */

.idayat-cart-coupon {
    padding: 20px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.idayat-coupon-panel {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.idayat-coupon-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    transition: background 0.2s ease;
    text-align: left;
}

.idayat-coupon-toggle:hover {
    background: #f9fafb;
}

.idayat-coupon-toggle[aria-expanded="true"] .idayat-coupon-toggle-icon {
    transform: rotate(180deg);
}

.idayat-coupon-toggle-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.idayat-coupon-content {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.idayat-coupon-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.idayat-coupon-input-wrapper {
    position: relative;
    flex: 1;
}

.idayat-coupon-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    transition: all 0.2s ease;
}

.idayat-coupon-input:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

/* Floating label effect */
.idayat-coupon-input-wrapper label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #6b7280;
    pointer-events: none;
    transition: all 0.2s ease;
    background: #ffffff;
    padding: 0 4px;
}

.idayat-coupon-input:focus + label,
.idayat-coupon-input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 12px;
    color: #111827;
}

.idayat-btn-apply-coupon {
    padding: 12px 24px;
    background: #111827;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.idayat-btn-apply-coupon:hover {
    background: #1f2937;
}

.idayat-btn-apply-coupon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.idayat-applied-coupons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.idayat-coupon-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ecfdf5;
    color: #065f46;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #d1fae5;
}

.idayat-coupon-tag svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.idayat-coupon-tag-remove {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #059669;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s ease;
    border-radius: 50%;
}

.idayat-coupon-tag-remove:hover {
    color: #047857;
    background: rgba(5, 150, 105, 0.1);
}

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

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

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

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

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

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

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

.idayat-btn-checkout {
    width: 100%;
    padding: 16px;
    background: #111827;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.idayat-btn-checkout:hover {
    background: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.idayat-btn-view-cart {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.idayat-btn-view-cart:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

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

.idayat-cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000000;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease;
}

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

.idayat-notification-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.idayat-notification-icon.success {
    color: #10b981;
}

.idayat-notification-icon.error {
    color: #ef4444;
}

.idayat-notification-content {
    flex: 1;
}

.idayat-notification-text {
    font-size: 14px;
    color: #111827;
    margin: 0;
    line-height: 1.5;
}

.idayat-notification-close {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    transition: color 0.2s ease;
}

.idayat-notification-close:hover {
    color: #111827;
}

/* ========================================
   LOADING STATE
======================================== */

.idayat-loading {
    pointer-events: none;
    opacity: 0.6;
}

.idayat-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #111827;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 480px) {
    .idayat-cart-canvas {
        max-width: 100%;
    }
    
    .idayat-cart-item {
        gap: 12px;
        padding: 16px;
    }
    
    .idayat-cart-item-image {
        width: 80px;
        height: 110px;
    }
    
    .idayat-recommendations-grid {
        grid-template-columns: 1fr;
    }
    
    .idayat-recommendation-image {
        height: 200px;
    }
}
