/* ============================================
   JoulCoffee - Custom Styles
   Dark Coffee Theme
   ============================================ */

/* ---- Base ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1210;
}

::-webkit-scrollbar-thumb {
    background: #c8956c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e8c4a0;
}

/* ---- Navigation Links ---- */
.nav-link {
    position: relative;
    color: #e8c4a0;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #c8956c, #e8c4a0);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover,
.nav-link.active {
    color: #c8956c;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ---- Product Card ---- */
.product-card {
    background: linear-gradient(145deg, #2d1f1a, #3a2a22);
    border: 1px solid rgba(200, 149, 108, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(200, 149, 108, 0.1);
    border-color: rgba(200, 149, 108, 0.3);
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #3a2a22, #2d1f1a);
    /* Removed aspect-ratio to allow natural image height */
}

.product-card .product-image img {
    width: 100%;
    height: auto; /* Natural height based on image original ratio */
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-card .discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

/* ---- Buttons ---- */
.btn-primary {
    background: linear-gradient(135deg, #c8956c, #b07d55);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d4a574, #c8956c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(200, 149, 108, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: #c8956c;
    padding: 0.75rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    border: 2px solid #c8956c;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(200, 149, 108, 0.1);
    transform: translateY(-2px);
}

/* ---- All Products Button (Attention-Grabbing) ---- */
.btn-all-products {
    position: relative;
    background: linear-gradient(135deg, #c8956c, #b07d55);
    color: white;
    padding: 1rem 3rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-all-products::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

.btn-all-products:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(200, 149, 108, 0.4);
}

.btn-all-products .arrow-icon {
    transition: transform 0.3s ease;
}

.btn-all-products:hover .arrow-icon {
    transform: translateX(-5px);
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* ---- Pulse animation for CTA ---- */
.pulse-ring {
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(200, 149, 108, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(200, 149, 108, 0); }
    100% { box-shadow: 0 0 0 0 rgba(200, 149, 108, 0); }
}

/* ---- Add to Cart Animation ---- */
.cart-add-animation {
    animation: cartPulse 0.6s ease-out;
}

@keyframes cartPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.2); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.cart-success {
    animation: cartSuccess 0.5s ease;
}

@keyframes cartSuccess {
    0% { background: linear-gradient(135deg, #c8956c, #b07d55); }
    50% { background: linear-gradient(135deg, #22c55e, #16a34a); }
    100% { background: linear-gradient(135deg, #c8956c, #b07d55); }
}

/* ---- Fade In Animation ---- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* ---- Skeleton Loading ---- */
.skeleton {
    background: linear-gradient(90deg, #3a2a22 25%, #4a3a32 50%, #3a2a22 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Feature Cards ---- */
.feature-card {
    background: linear-gradient(145deg, rgba(45, 31, 26, 0.8), rgba(58, 42, 34, 0.8));
    border: 1px solid rgba(200, 149, 108, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: rgba(200, 149, 108, 0.3);
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, rgba(200, 149, 108, 0.2), rgba(200, 149, 108, 0.05));
}

/* ---- Review Card ---- */
.review-card {
    background: linear-gradient(145deg, #2d1f1a, #3a2a22);
    border: 1px solid rgba(200, 149, 108, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.review-card:hover {
    border-color: rgba(200, 149, 108, 0.3);
}

/* ---- Image Gallery ---- */
.gallery-thumb {
    border: 2px solid transparent;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: #c8956c;
    opacity: 1;
}

/* ---- Quantity Selector ---- */
.qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    background: rgba(200, 149, 108, 0.15);
    color: #c8956c;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(200, 149, 108, 0.2);
    font-size: 1.2rem;
    font-weight: 700;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
}

.qty-btn:hover {
    background: rgba(200, 149, 108, 0.3);
}

.qty-input {
    width: 60px;
    text-align: center;
    background: transparent;
    border: none;
    color: #f5ebe0;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    outline: none;
}

/* ---- Form Inputs ---- */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(45, 31, 26, 0.8);
    border: 1px solid rgba(200, 149, 108, 0.2);
    border-radius: 0.75rem;
    color: #f5ebe0;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #c8956c;
    box-shadow: 0 0 0 3px rgba(200, 149, 108, 0.15);
}

.form-input::placeholder {
    color: #8b7355;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e8c4a0;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ---- Pagination ---- */
.pagination-btn {
    min-width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(200, 149, 108, 0.2);
    background: rgba(45, 31, 26, 0.8);
    color: #e8c4a0;
    font-family: 'Cairo', sans-serif;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: linear-gradient(135deg, #c8956c, #b07d55);
    color: white;
    border-color: transparent;
}

/* ---- Toast Notification ---- */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #2d1f1a, #3a2a22);
    border: 1px solid rgba(200, 149, 108, 0.3);
    color: #f5ebe0;
    padding: 1rem 2rem;
    border-radius: 1rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.5);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.5);
}

/* ---- Hero Section ---- */
.hero-gradient {
    background: radial-gradient(ellipse at 30% 50%, rgba(200, 149, 108, 0.15), transparent 60%),
                radial-gradient(ellipse at 70% 20%, rgba(176, 125, 85, 0.1), transparent 50%);
}

/* ---- Glass Effect ---- */
.glass {
    background: rgba(45, 31, 26, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 149, 108, 0.1);
}

/* ---- Badge ---- */
.badge-new {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    animation: badge-glow 2s infinite;
}

@keyframes badge-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 0 15px rgba(34, 197, 94, 0.5); }
}

/* ---- Product Image Placeholder ---- */
.product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3a2a22, #2d1f1a);
}

.product-placeholder svg {
    width: 48px;
    height: 48px;
    color: #6b4226;
    opacity: 0.5;
}

/* ---- Old Price Strike ---- */
.old-price {
    position: relative;
}

.old-price::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    transform: rotate(-5deg);
}

/* ---- Responsive utilities ---- */
@media (max-width: 768px) {
    .hero-text {
        font-size: 2rem !important;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ---- Loading Spinner ---- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(200, 149, 108, 0.2);
    border-top-color: #c8956c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ---- Cart Item ---- */
.cart-item {
    background: linear-gradient(145deg, #2d1f1a, #3a2a22);
    border: 1px solid rgba(200, 149, 108, 0.1);
    border-radius: 1rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: rgba(200, 149, 108, 0.2);
}

/* ---- Success Page ---- */
.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: successPop 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- Search Input ---- */
.search-input {
    background: rgba(45, 31, 26, 0.8);
    border: 1px solid rgba(200, 149, 108, 0.2);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    color: #f5ebe0;
    width: 100%;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: #c8956c;
    box-shadow: 0 0 0 3px rgba(200, 149, 108, 0.15);
}

/* ---- Category Filter Chip ---- */
.filter-chip {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(200, 149, 108, 0.2);
    background: rgba(45, 31, 26, 0.8);
    color: #e8c4a0;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Cairo', sans-serif;
}

.filter-chip:hover,
.filter-chip.active {
    background: linear-gradient(135deg, #c8956c, #b07d55);
    color: white;
    border-color: transparent;
}

/* ---- Upsell Card ---- */
.upsell-card {
    background: linear-gradient(145deg, #2d1f1a, #3a2a22);
    border: 1px solid rgba(200, 149, 108, 0.15);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.upsell-card::before {
    content: '-10%';
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

.upsell-card:hover {
    border-color: rgba(200, 149, 108, 0.3);
}

/* ---- Card Buttons ---- */
.btn-card-more {
    background: linear-gradient(135deg, #c8956c, #8b5e3c);
    color: white;
    padding: 0.65rem 1rem;
    border-radius: 0.75rem; /* Match card rounding */
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(139, 94, 60, 0.2);
    z-index: 20;
    position: relative;
    width: 100%;
    margin-top: 1rem;
}

.btn-card-more:hover {
    background: linear-gradient(135deg, #d4a574, #b07d55);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(139, 94, 60, 0.4);
}

.product-card:hover .btn-card-more {
    background: linear-gradient(135deg, #f5ebe0, #c8956c);
    color: #2d1f1a;
}

/* ---- Line Clamp ---- */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Stretched Link ---- */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    content: "";
}

.product-card {
    position: relative; /* Ensure stretched link works */
}

/* Mobile Tweaks */
@media (max-width: 640px) {
    .product-card .p-4 {
        padding: 0.75rem !important;
    }
    .product-card h3 {
        font-size: 0.95rem !important;
    }

}
