/**
 * Shopping Cart Styles for Solid Gate
 * Includes cart badge, notifications, and mini cart preview
 */

/* ===========================
   Cart Count Badge
   =========================== */
#cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

#cart-count.show {
    display: inline-flex;
}

/* Pulse animation for cart badge */
.pulse-animation {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* ===========================
   Cart Icon Container
   =========================== */
.cart-icon {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 10px;
}

.cart-icon:hover {
    opacity: 0.8;
}

/* ===========================
   Notifications
   =========================== */
.cart-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    min-width: 300px;
    transition: right 0.3s ease-in-out;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cart-notification.show {
    right: 20px;
}

.cart-notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.cart-notification-success {
    border-left: 4px solid #28a745;
}

.cart-notification-success .cart-notification-icon {
    background-color: #28a745;
    color: white;
}

.cart-notification-error {
    border-left: 4px solid #dc3545;
}

.cart-notification-error .cart-notification-icon {
    background-color: #dc3545;
    color: white;
}

.cart-notification-message {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* ===========================
   Cart Page Product Links
   =========================== */
.cart-product-name {
    color: #0e3466;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.cart-product-name:hover {
    color: #2ecc71;
    text-decoration: underline;
}

.cart-product-image {
    transition: opacity 0.2s ease;
}

.product-cell a:hover .cart-product-image {
    opacity: 0.8;
}

.cart-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-product-variant {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* ===========================
   Add to Cart Button States
   =========================== */
.add-to-cart {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.add-to-cart.added {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

.add-to-cart.added::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: white;
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===========================
   Form Row Layout
   =========================== */
.form-row {
    display: flex;
    gap: 15px;
}

.form-group-half {
    flex: 1;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .cart-notification {
        min-width: auto;
        left: 20px;
        right: -400px;
        max-width: calc(100% - 40px);
    }

    .cart-notification.show {
        right: 20px;
    }
}

@media (max-width: 480px) {
    .cart-notification {
        padding: 12px 16px;
    }

    .cart-notification-message {
        font-size: 13px;
    }
}
