/**
 * Unified Cart Styles - CleanCat.ie
 * Version: 1.0 - Consistent cart UI across mobile and desktop
 */

/* ===== CART MODAL STYLES ===== */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.cart-modal-overlay.show .cart-modal {
    transform: scale(1) translateY(0);
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.cart-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.cart-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cart-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* ===== CART ITEMS ===== */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    max-height: 400px;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    min-width: 0;
}

.cart-item-details h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.cart-item-price {
    font-size: 0.9rem;
    color: #007bff;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-item-description {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.3;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 4px;
}

.cart-item-quantity button {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s ease;
}

.cart-item-quantity button:hover {
    background: #007bff;
    color: white;
}

.cart-item-quantity .qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: #333;
}

.cart-item-total {
    font-weight: 600;
    color: #333;
    text-align: right;
    min-width: 60px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
}

.cart-item-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.cart-item-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* ===== CART SUMMARY ===== */
.cart-summary {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item.total-row {
    font-size: 1.1rem;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
    margin-top: 8px;
}

/* ===== CART ACTIONS ===== */
.cart-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
}

.cart-actions .btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

/* ===== EMPTY CART ===== */
.cart-empty {
    text-align: center;
    padding: 40px 24px;
    color: #666;
}

.cart-empty p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

/* ===== MOBILE HEADER STYLES ===== */
.mobile-sticky-header-simple {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-sticky-logo-simple img {
    height: 40px;
    width: auto;
}

.mobile-nav-center-simple {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Mobile services button styles moved to mobile-header-unified.css */

.mobile-cart-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-cart-btn-simple {
    position: relative;
    padding: 8px;
    color: #333;
    text-decoration: none;
}

.mobile-cart-btn-simple svg {
    width: 24px;
    height: 24px;
}

.mobile-cart-count-simple {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(50%, -50%);
}

.mobile-cart-count-simple.hidden {
    display: none !important;
}

.mobile-make-order-btn {
    background: #ff6b35;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.mobile-make-order-btn.show {
    display: flex;
}

.mobile-make-order-btn:hover {
    background: #ff8c42;
    color: white;
}

.mobile-order-count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== MOBILE BODY SPACING ===== */
body.mobile-header-simple-active {
    padding-top: 60px;
}

/* ===== DESKTOP CART ICON ===== */
.cart-icon {
    position: relative;
    cursor: pointer;
    padding: 8px;
    color: #333;
    transition: all 0.2s ease;
}

.cart-icon:hover {
    color: #007bff;
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(50%, -50%);
}

.cart-count.hidden {
    display: none;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .cart-modal {
        width: 95vw;
        max-height: 85vh;
    }
    
    .cart-modal-header {
        padding: 16px 20px;
    }
    
    .cart-modal-header h3 {
        font-size: 1.3rem;
    }
    
    .cart-items-container {
        padding: 12px 20px;
        max-height: 300px;
    }
    
    .cart-item {
        grid-template-columns: 60px 1fr auto;
        gap: 12px;
        grid-template-areas: 
            "image details actions"
            "image quantity total";
    }
    
    .cart-item-image {
        grid-area: image;
        width: 60px;
        height: 60px;
    }
    
    .cart-item-details {
        grid-area: details;
    }
    
    .cart-item-quantity {
        grid-area: quantity;
        justify-self: start;
    }
    
    .cart-item-total {
        grid-area: total;
        justify-self: end;
        align-self: end;
    }
    
    .cart-item-actions {
        grid-area: actions;
        justify-self: end;
        align-self: start;
    }
    
    .cart-summary {
        padding: 12px 20px;
    }
    
    .cart-actions {
        padding: 16px 20px;
        flex-direction: column;
    }
}

/* ===== ADD TO CART BUTTON STYLES ===== */
.add-to-cart-btn {
    transition: all 0.2s ease;
}

.add-to-cart-btn.processing {
    opacity: 0.7;
    pointer-events: none;
}

.add-to-cart-btn.added {
    background: #ff6b35 !important;
    color: white !important;
}

.add-to-cart-btn.error {
    background: #dc3545 !important;
    color: white !important;
}

/* ===== NOTIFICATIONS ===== */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    max-width: 300px;
}

.notification {
    background: white;
    border-left: 4px solid #007bff;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

.notification-success {
    border-left-color: #ff6b35;
}

.notification-error {
    border-left-color: #dc3545;
}

.notification-info {
    border-left-color: #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ===== MOBILE SPECIFIC STYLES ===== */
@media (max-width: 768px) {
    /* Hide service descriptions on mobile to save space */
    .cart-item-description {
        display: none !important;
    }
    
    /* Adjust cart item spacing for mobile */
    .cart-item {
        padding: 12px 16px !important;
    }
    
    /* Make cart items more compact on mobile */
    .cart-item-details h4 {
        margin-bottom: 4px !important;
        font-size: 0.9rem !important;
    }
    
    /* Adjust cart item layout for better mobile experience */
    .cart-items-container {
        max-height: 50vh !important;
        overflow-y: auto !important;
    }
}