/* ==========================================
   CHECKOUT & CART PAGE STYLES (FIXED)
   ========================================== */

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

.cart-page-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.cart-page-items {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    overflow: hidden;
}

.cart-page-summary {
    position: sticky;
    top: 104px;
    height: fit-content;
    min-width: 0;
    max-width: 100%;
}

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

.empty-cart-state {
    text-align: center;
    padding: 80px 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.empty-cart-state .empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: #cbd5e1;
}

.empty-cart-state h3 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.empty-cart-state p {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 32px;
}

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

.cart-page-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    Margin-top: 10px;
}

.cart-page-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.cart-page-item-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cart-page-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.cart-page-item-name {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-page-item-price {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.price-current {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-old {
    font-size: 16px;
    color: #94a3b8;
    text-decoration: line-through;
}

.cart-page-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    justify-content: space-between;
    flex-shrink: 0;
}

.cart-page-item-total {
    font-size: 28px;
    font-weight: 800;
    color: #16a34a;
    white-space: nowrap;
}

/* ==========================================
   QUANTITY SELECTOR
   ========================================== */

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(248, 250, 252, 0.8);
    padding: 8px;
    border-radius: 12px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.qty-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    color: white;
    transform: scale(1.1);
}

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

.qty-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.qty-input {
    width: 70px;
    height: 40px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    background: white;
    transition: all 0.2s;
}

.qty-input:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.1);
}

.btn-remove {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-remove:hover:not(:disabled) {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.btn-remove:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-remove svg {
    width: 20px;
    height: 20px;
}

/* ==========================================
   CART SUMMARY
   ========================================== */

.summary-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.summary-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 0;
    border-top: 2px solid #f1f5f9;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: #64748b;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    padding-top: 16px;
    border-top: 2px solid #e2e8f0;
    margin-top: 12px;
}

.payment-methods {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
    text-align: center;
}

.payment-methods small {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.payment-icons span {
    padding: 6px 10px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 8px;
    font-size: 12px;
    color: #475569;
    font-weight: 600;
}

/* ==========================================
   CHECKOUT CONTAINER - FIXED
   ========================================== */

.checkout-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.checkout-forms {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    overflow: hidden;
}

.checkout-summary {
    position: sticky;
    top: 104px;
    height: fit-content;
    min-width: 0;
    max-width: 100%;
}

/* ==========================================
   CHECKOUT SECTION
   ========================================== */

.checkout-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.checkout-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
}

.checkout-section-title .icon {
    width: 22px;
    height: 22px;
    color: #8b5cf6;
    flex-shrink: 0;
}

/* ==========================================
   SUMMARY ITEMS
   ========================================== */

.summary-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 350px;
    overflow-y: auto;
}

.summary-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: rgba(248, 250, 252, 0.6);
    border-radius: 12px;
    transition: all 0.2s;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.summary-item:hover {
    background: rgba(248, 250, 252, 0.9);
}

.summary-item-image {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.summary-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.summary-item-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-item-qty {
    font-size: 12px;
    color: #64748b;
}

.summary-item-price {
    font-weight: 700;
    color: #ec4899;
    font-size: 14px;
    flex-shrink: 0;
    white-space: nowrap;
}

.summary-totals {
    border-top: 2px solid #f1f5f9;
    padding-top: 16px;
    margin-bottom: 20px;
}

/* ==========================================
   ADDRESS DISPLAY
   ========================================== */

.address-display-box {
    background: rgba(248, 250, 252, 0.8);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.2s;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.address-display-box:hover {
    border-color: #cbd5e1;
    background: rgba(248, 250, 252, 1);
}

.address-display-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.address-line {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.5;
    word-break: break-word;
}

.address-line strong {
    font-weight: 700;
    color: #0f172a;
}

.loading-text {
    color: #64748b;
    font-style: italic;
    margin: 0;
}

/* ==========================================
   INFO BOX
   ========================================== */

.info-box {
    padding: 16px;
    background: rgba(248, 250, 252, 0.6);
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    box-sizing: border-box;
    max-width: 100%;
}

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

.info-row span:first-child {
    color: #64748b;
}

.info-row strong {
    color: #1e293b;
}

.payment-info {
    margin-top: 16px;
    padding: 14px;
    background: #fef3c7;
    border-radius: 12px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.6;
}

/* ==========================================
   LEGAL CHECKBOXES
   ========================================== */

.legal-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: rgba(248, 250, 252, 0.6);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
    box-sizing: border-box;
    max-width: 100%;
}

.legal-checkboxes .checkbox-label {
    padding: 0;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: transparent;
}

.legal-checkboxes .checkbox-label:hover {
    background: transparent;
}

.legal-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #ec4899;
    flex-shrink: 0;
}

.legal-checkboxes .checkbox-label span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    line-height: 1.5;
}

.legal-checkboxes a {
    color: #ec4899;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.legal-checkboxes a:hover {
    color: #d946ef;
    text-decoration: underline;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 12px;
    color: #64748b;
    padding: 10px;
    background: rgba(248, 250, 252, 0.6);
    border-radius: 8px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ==========================================
   BREADCRUMB
   ========================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
    transition: all 0.2s;
}

.breadcrumb a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.breadcrumb span:not(:last-child) {
    color: #94a3b8;
}

/* ==========================================
   RESPONSIVE - TABLET
   ========================================== */

@media (max-width: 1024px) {
    .cart-page-container,
    .checkout-container {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }
    
    .cart-page-summary,
    .checkout-summary {
        position: static;
        max-width: 100%;
    }
    
    .summary-card {
        max-width: 100%;
    }
}

/* ==========================================
   RESPONSIVE - MOBILE
   ========================================== */

@media (max-width: 768px) {
    .cart-page-container,
    .checkout-container {
        padding: 0 12px;
        gap: 16px;
    }
    
    .cart-page-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }
    
    .cart-page-item-image {
        width: 100%;
        height: 180px;
    }
    
    .cart-page-item-actions {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .checkout-section {
        padding: 16px;
        border-radius: 16px;
    }
    
    .checkout-section-title {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    .summary-card {
        padding: 16px;
        border-radius: 16px;
    }
    
    .summary-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .cart-page-item-name {
        white-space: normal;
        font-size: 18px;
    }
    
    .cart-page-item-total {
        font-size: 22px;
    }
    
    .summary-item {
        padding: 10px;
    }
    
    .summary-item-image {
        width: 48px;
        height: 48px;
    }
    
    .summary-item-name {
        font-size: 13px;
    }
    
    .summary-item-price {
        font-size: 13px;
    }
    
    .legal-checkboxes {
        padding: 12px;
    }
    
    .legal-checkboxes .checkbox-label span {
        font-size: 12px;
    }
    
    .btn-large {
        padding: 14px;
        font-size: 15px;
    }
    
    .address-display-box {
        padding: 14px;
    }
    
    .address-line {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cart-page-container,
    .checkout-container {
        padding: 0 8px;
    }
    
    .quantity-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cart-page-item-total {
        font-size: 20px;
    }
    
    .price-current {
        font-size: 20px;
    }
    
    .checkout-section {
        padding: 14px;
    }
    
    .summary-card {
        padding: 14px;
    }
    
    .summary-items {
        max-height: 250px;
    }
    
    .summary-item-image {
        width: 44px;
        height: 44px;
    }
    
    .legal-checkboxes .checkbox-label span {
        font-size: 11px;
        line-height: 1.4;
    }
    
    .legal-checkboxes input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    .btn-large {
        padding: 12px;
        font-size: 14px;
        border-radius: 12px;
    }
    
    .security-note {
        font-size: 11px;
        padding: 8px;
    }
}

/* ==========================================
   PRODUCT CAROUSEL STYLES
   ========================================== */

.available-products-section {
    margin-top: 32px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

.available-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.available-products-title {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.carousel-controls {
    display: none;
    gap: 10px;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
    flex-shrink: 0;
}

.carousel-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-btn svg {
    width: 18px;
    height: 18px;
}

.products-carousel-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.products-carousel {
    display: flex;
    gap: 16px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 4px;
}

.carousel-product-card {
    flex: 0 0 auto;
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(236, 72, 153, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.carousel-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.2);
    border-color: rgba(236, 72, 153, 0.3);
}

.carousel-product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #f8fafc;
}

.carousel-product-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.carousel-product-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    min-height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.carousel-product-stock {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    width: fit-content;
}

.carousel-product-stock.in-stock {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.carousel-product-stock.low-stock {
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
}

.carousel-product-stock.out-of-stock {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.carousel-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #f1f5f9;
    gap: 8px;
}

.carousel-product-price {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.carousel-add-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
    flex-shrink: 0;
}

.carousel-add-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.carousel-add-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-add-btn svg {
    width: 20px;
    height: 20px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    width: 20px;
    border-radius: 4px;
}

/* Desktop: 3 products per slide */
@media (min-width: 1024px) {
    .carousel-product-card {
        width: calc((100% - 32px) / 3);
    }
    
    .carousel-controls {
        display: flex;
    }
}

/* Tablet: 2 products per slide */
@media (min-width: 640px) and (max-width: 1023px) {
    .carousel-product-card {
        width: calc((100% - 16px) / 2);
    }
    
    .carousel-controls {
        display: flex;
    }
}

/* Mobile: 1 product per slide */
@media (max-width: 639px) {
    .carousel-product-card {
        width: 100%;
    }
    
    .carousel-controls {
        display: flex;
    }
    
    .available-products-section {
        padding: 16px;
        margin-top: 20px;
        border-radius: 16px;
    }
    
    .available-products-title {
        font-size: 16px;
    }
    
    .carousel-product-name {
        font-size: 13px;
        min-height: 32px;
    }
    
    .carousel-product-price {
        font-size: 18px;
    }
}