/* ============================================
   CART DRAWER STYLES - Right-side Off-Canvas
   ============================================ */

/* ========== CHECKOUT MODAL STYLES ========== */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.checkout-modal.active {
    opacity: 1;
    visibility: visible;
}

.checkout-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.checkout-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.checkout-modal.active .checkout-modal-content {
    transform: scale(1);
}

.checkout-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.checkout-modal-close:hover {
    color: #333;
}

.checkout-modal-title {
    color: #000413;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkout-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkout-form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.checkout-form-group input[type="text"],
.checkout-form-group input[type="tel"] {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.checkout-form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.checkout-form-group.error input {
    border-color: #dc3545;
}

.checkout-error {
    color: #dc3545;
    font-size: 0.85rem;
    min-height: 1.2em;
}

.checkout-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkout-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.checkout-radio:hover {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.checkout-radio input[type="radio"] {
    display: none;
}

.checkout-radio .radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkout-radio input[type="radio"]:checked + .radio-custom {
    border-color: #007bff;
    background: #007bff;
}

.checkout-radio input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.checkout-action-container {
    margin: 0.5rem 0;
}

.checkout-whish-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #25D366 0%, #20b557 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.checkout-whish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    color: white;
}

.checkout-submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    margin-top: 0.5rem;
}

.checkout-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.checkout-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Thank you message */
.checkout-thankyou {
    text-align: center;
    padding: 2rem 1rem;
}

.thankyou-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1rem;
}

.checkout-thankyou h2 {
    color: #000413;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.thankyou-message {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.checkout-close-thankyou {
    padding: 0.75rem 2rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-close-thankyou:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* Mobile responsive */
@media (max-width: 500px) {
    .checkout-modal-content {
        padding: 1.5rem;
        width: 95%;
        max-height: 85vh;
    }
    
    .checkout-modal-title {
        font-size: 1.3rem;
    }
    
    .checkout-form-group input {
        font-size: 1rem;
        padding: 0.65rem 0.9rem;
    }
    
    .checkout-radio {
        padding: 0.6rem 0.9rem;
    }
    
    .checkout-submit-btn {
        padding: 0.85rem;
        font-size: 1rem;
    }
}

/* Cart Drawer Overlay */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Cart Drawer Panel */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    max-width: 500px;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.cart-drawer.active {
    transform: translateX(0);
}

/* Back Arrow Button Only */
.cart-drawer-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: #000413;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cart-drawer-close:hover {
    background-color: #007bff;
    transform: rotate(-90deg);
}

.cart-drawer-close:active {
    transform: rotate(-90deg) scale(0.95);
}

.cart-drawer-close i {
    pointer-events: none;
}

/* Cart Content Container - EXACT COPY of cart.html styles */
.cart-drawer .cart-section {
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
    margin-top: 60px; /* Space for fixed close button */
}

.cart-drawer .cart-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #000413;
    padding-right: 40px; /* Account for close button */
}

.cart-drawer .cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 1rem;
    background: white;
    border-radius: 12px;
    margin: 0 1rem 0.75rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cart-drawer .cart-item-img-link {
    flex-shrink: 0;
}

.cart-drawer .cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 8px;
    background-color: #f8f9fa;
    padding: 5px;
}

.cart-drawer .cart-item-info {
    flex: 1;
    min-width: 150px;
}

.cart-drawer .cart-item-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #1a1a2e;
}

.cart-drawer .cart-item-info p {
    color: #666;
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.cart-drawer .cart-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cart-drawer .view-item-btn,
.cart-drawer .remove-from-cart-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
}

.cart-drawer .view-item-btn {
    background-color: #007bff;
    color: white;
}

.cart-drawer .view-item-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    color: white;
}

.cart-drawer .remove-from-cart-btn {
    background-color: #dc3545;
    color: white;
}

.cart-drawer .remove-from-cart-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.cart-drawer .empty-cart-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.cart-drawer .empty-cart-message h2 {
    font-size: 1.3rem;
    color: #28a745;
    margin-bottom: 0.5rem;
}

.cart-drawer .cart-total {
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 1rem;
    text-align: center;
    padding: 1rem;
    background: white;
    margin: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding-right: 40px; /* Account for close button */
}

.cart-drawer .cart-buttons-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
    padding: 0 1rem 1.5rem 1rem;
}

.cart-drawer .clear-cart-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.cart-drawer .clear-cart-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.cart-drawer .cta-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-drawer .cta-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    color: white;
}

.cart-drawer .clear-cart-btn.hidden,
.cart-drawer .cta-button.hidden {
    display: none;
}

/* ============================================
   CHECKOUT MODAL STYLES
   ============================================ */

/* Checkout Modal Overlay */
.checkout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.checkout-modal-overlay.active {
    display: flex;
}

/* Checkout Modal Content */
.checkout-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: checkoutModalSlideIn 0.3s ease;
}

@keyframes checkoutModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.checkout-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.checkout-modal-header h2 {
    color: #000413;
    font-size: 1.4rem;
    margin: 0;
}

.checkout-modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.3s;
}

.checkout-modal-close:hover {
    color: #333;
}

/* Modal Body */
.checkout-modal-body {
    padding: 25px;
}

/* Form Groups */
.checkout-form-group {
    margin-bottom: 20px;
}

.checkout-form-group label {
    display: block;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}

.checkout-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.checkout-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkout-input.error {
    border-color: #dc3545;
}

.checkout-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Payment Section */
.checkout-payment-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.checkout-payment-section > label {
    display: block;
    color: #333;
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 0.95rem;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.payment-option input[type="radio"] {
    margin-right: 12px;
    accent-color: #667eea;
    transform: scale(1.2);
}

.payment-option-text {
    flex: 1;
}

.payment-option-text span {
    display: block;
    color: #333;
    font-weight: 500;
}

.payment-option-text small {
    color: #666;
    font-size: 0.85rem;
}

/* Buttons */
.checkout-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.checkout-whish-btn {
    display: none;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #25D366 0%, #20B857 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.checkout-whish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
    color: white;
}

.checkout-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.checkout-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.checkout-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Thank You Message */
.checkout-thankyou {
    text-align: center;
    padding: 40px 20px;
}

.checkout-thankyou-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 20px;
}

.checkout-thankyou h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.checkout-thankyou p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.checkout-thankyou-btn {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.checkout-thankyou-btn:hover {
    background: #5a6fd6;
}

/* Responsive */
@media (max-width: 480px) {
    .checkout-modal-content {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
    }
    
    .checkout-modal-header {
        padding: 15px 20px;
    }
    
    .checkout-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .checkout-modal-body {
        padding: 20px;
    }
    
    .payment-option {
        padding: 12px;
    }
}

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

/* Desktop and Tablet (768px and up) */
@media (min-width: 768px) {
    .cart-drawer {
        width: 75%;
        max-width: 450px;
    }
    
    .cart-drawer-close {
        top: 25px;
        right: 25px;
    }
    
    .cart-drawer .cart-section {
        padding: 2rem 0;
        margin-top: 70px;
    }
    
    .cart-drawer .cart-item {
        padding: 1.25rem;
    }
    
    .cart-drawer .cart-item-img {
        width: 80px;
        height: 80px;
    }
}

/* Mobile (767px and below) */
@media (max-width: 767px) {
    .cart-drawer {
        width: 100%;
        max-width: 100%;
        right: 0;
    }
    
    .cart-drawer-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .cart-drawer .cart-section {
        margin-top: 55px;
        padding: 1rem 0;
    }
    
    .cart-drawer .cart-section h2 {
        font-size: 1.25rem;
        padding-right: 50px;
    }
    
    .cart-drawer .cart-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .cart-drawer .cart-item-img {
        width: 100%;
        max-width: 100px;
        height: auto;
    }
    
    .cart-drawer .cart-item-info {
        width: 100%;
        min-width: 0;
    }
    
    .cart-drawer .cart-item-actions {
        width: 100%;
        justify-content: center;
    }
    
    .cart-drawer .view-item-btn,
    .cart-drawer .remove-from-cart-btn {
        flex: 1;
        justify-content: center;
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .cart-drawer .cart-buttons-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cart-drawer .clear-cart-btn,
    .cart-drawer .cta-button {
        width: 100%;
        justify-content: center;
        padding: 0.85rem 1rem;
    }
    
    .cart-drawer .cart-total {
        margin: 1rem;
        padding-right: 50px;
    }
}

/* Extra small mobile (480px and below) */
@media (max-width: 480px) {
    .cart-drawer-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
    
    .cart-drawer .cart-section h2 {
        font-size: 1.1rem;
    }
    
    .cart-drawer .cart-item-img {
        max-width: 80px;
    }
}

/* ============================================
   BODY SCROLL LOCK
   ============================================ */

body.cart-drawer-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ============================================
   ANIMATION UTILITIES
   ============================================ */

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

/* ============================================
   SUBSCRIPTION BADGE IN CART
   ============================================ */

.item-subscription-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.4rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

