/* Header Styles */
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent double-tap zoom on all interactive elements */
button,
a,
input,
select,
textarea,
.carousel-control,
.bestsellers-control,
.testimonials-control,
[role="button"],
[onclick] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.announcement-bar {
    background-color: #5A3518;
    color: white;
    overflow: hidden;
    position: relative;
    z-index: 100;
    position: relative;
    height: 40px;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    box-sizing: border-box;
}

.announcement-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.announcement-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s ease, transform 0.5s ease, background-color 0.3s ease;
    background-color: #5A3518;
    box-sizing: border-box;
}

.announcement-slide:hover {
    background-color: #333333;
}

.announcement-slide:nth-child(1) {
    animation: slideIn 15s infinite;
}

.announcement-slide:nth-child(2) {
    animation: slideIn 15s infinite 5s;
}

.announcement-slide:nth-child(3) {
    animation: slideIn 15s infinite 10s;
}

.announcement-bar__message {
    margin: 0;
    padding: 8px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #f0f0f0;
    cursor: default;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

@keyframes slideIn {
    0%, 100% {
        opacity: 0;
        transform: translateY(100%);
    }
    3%, 30% {
        opacity: 1;
        transform: translateY(0);
    }
    33%, 97% {
        opacity: 0;
        transform: translateY(-100%);
    }
}

.header {
    background-color: white;
    width: 100%;
    z-index: 90;
    position: relative;
    margin: 0;
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
}

/* Sticky header states - only when scrolling up */
.header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
}

.header-hidden {
    transform: translateY(-100%);
}

.header-visible {
    transform: translateY(0);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.logo-container {
    text-align: center;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.logo {
    max-height: 60px;
    width: auto;
    box-sizing: border-box;
}

.nav-container {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.nav-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.nav-item {
    margin: 0;
    box-sizing: border-box;
}

.nav-item a {
    color: #000000;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    box-sizing: border-box;
}

.nav-item a:hover,
.nav-item a.active {
    color: #5A3518;
}

.nav-item a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #5A3518;
}

.cart-icon {
    position: relative;
    font-size: 1.2rem;
    color: #000000;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Custom cart icon image */
.cart-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Mobile cart toggle icon */
.mobile-cart-toggle .cart-icon-img {
    width: 26px;
    height: 26px;
}

/* Cart Badge - Count Indicator */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #5A3518;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cart-badge.visible {
    display: flex;
}

/* Mobile cart badge positioning */
.mobile-cart-toggle {
    position: relative;
}

.mobile-cart-toggle .cart-badge {
    top: -6px;
    right: -6px;
}

/* Desktop cart badge positioning */
.cart-icon {
    position: relative;
}

.cart-icon .cart-badge {
    top: -10px;
    right: -10px;
}

.cart-notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    pointer-events: none;
}

.cart-notification-overlay.show {
    display: block;
    pointer-events: auto;
}

.cart-notification-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-notification-overlay.show .cart-notification-backdrop {
    opacity: 1;
}

.cart-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.cart-notification-overlay.show .cart-notification {
    transform: translateY(0);
}

/* Hide old notifications on mobile */
@media (max-width: 767px) {
    .cart-notification:not(.cart-notification-overlay .cart-notification) {
        display: none !important;
    }
    
    .cart-notification-menu {
        display: none !important;
    }
    
    /* Also hide any standalone cart notifications */
    body > .cart-notification {
        display: none !important;
    }
}

.cart-notification__content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
}

.cart-notification__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.cart-notification__title {
    font-size: 20px;
    font-weight: 600;
    color: #202223;
    margin: 0;
}

.cart-notification__items-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-notification__item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-notification__item:last-child {
    border-bottom: none;
}

.cart-notification__item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.cart-notification__item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-notification__item-title {
    font-size: 14px;
    font-weight: 500;
    color: #202223;
    line-height: 1.3;
}

.cart-notification__item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.cart-notification__item-quantity-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 6px 10px;
}

.cart-notification__quantity-btn {
    background: none;
    border: none;
    color: #202223;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-notification__quantity-btn:active {
    transform: scale(0.95);
}

.cart-notification__quantity-value {
    color: #202223;
    font-weight: 600;
    font-size: 16px;
    min-width: 32px;
    text-align: center;
}

.cart-notification__item-price {
    color: #202223;
    font-weight: 600;
    font-size: 15px;
}

.cart-notification__item-remove {
    background: none;
    border: none;
    color: #6d7175;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    margin-left: 4px;
}

.cart-notification__item-remove:hover {
    color: #d72c0d;
}

.cart-notification__shipping {
    padding: 16px 0;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 20px;
}

.cart-notification__shipping-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.cart-notification__shipping-label {
    color: #202223;
    font-weight: 500;
}

.cart-notification__shipping-value {
    color: #5A3518;
    font-weight: 600;
}

.cart-notification__icon {
    width: 24px;
    height: 24px;
    box-sizing: border-box;
}

.cart-notification__close {
    background: none;
    border: none;
    font-size: 28px;
    color: #202223;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cart-notification__product {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.cart-notification__product img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    box-sizing: border-box;
}

.cart-notification__product-info {
    flex: 1;
    box-sizing: border-box;
}

.cart-notification__product-title {
    margin: 0;
    font-weight: 500;
    color: #f0f0f0;
    line-height: 1;
    box-sizing: border-box;
}

.cart-notification__product-price {
    margin: 5px 0 0;
    color: #333333;
    line-height: 1;
    box-sizing: border-box;
}

.cart-notification__buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 20px 24px;
}

.cart-notification__button {
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
}

.cart-notification__button--primary {
    background: #5A3518;
    color: #fff;
}

.cart-notification__button--primary:hover {
    background: #3D2817;
    transform: translateY(-1px);
}

.cart-notification__button--secondary {
    background: #fff;
    color: #5A3518;
    border: 2px solid #5A3518;
}

.cart-notification__button--secondary:hover {
    background: #f9f9f9;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #000000;
    box-sizing: border-box;
}

.mobile-cart-toggle {
    display: none;
    text-decoration: none;
    color: #000000;
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
    box-sizing: border-box;
}

.mobile-cart-toggle svg {
    width: 26px;
    height: 26px;
    stroke: #000000;
}

.mobile-cart-toggle .cart-count {
    display: none !important;
}

.mobile-cart-count {
    display: none !important;
    text-align: center;
    font-weight: 600;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu__header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    box-sizing: border-box;
}

.mobile-menu__close {
    background: none;
    border: none;
    color: #000000;
    font-size: 24px;
    cursor: pointer;
    box-sizing: border-box;
}

.mobile-menu__nav {
    padding: 20px;
    box-sizing: border-box;
}

.mobile-menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.mobile-menu__item {
    margin-bottom: 0;
    border-bottom: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.mobile-menu__item:last-child {
    border-bottom: none;
}

.mobile-menu__item a {
    color: #000000;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    display: block;
    padding: 18px 0;
    transition: all 0.2s ease;
    box-sizing: border-box;
    letter-spacing: 0.3px;
}

.mobile-menu__item a:hover {
    color: #5A3518;
    background: #f8f8f8;
    padding-left: 10px;
}

.mobile-menu__item .cart-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    box-sizing: border-box;
}

.mobile-menu-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .announcement-bar__message {
        padding: 6px 10px;
        font-size: 12px;
    }

    .header-container {
        position: relative;
        padding: 15px;
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    .logo-container {
        margin-bottom: 0;
        flex: 1;
        text-align: center;
    }

    .logo {
        max-height: 40px;
    }

    /* Hide desktop navigation */
    .nav-container {
        display: none !important;
    }

    .nav-links {
        display: none !important;
    }

    .nav-list {
        display: none !important;
    }

    /* Show mobile hamburger menu */
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
    }

    /* Show mobile cart icon */
    .mobile-cart-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
    }

    /* Hide desktop cart */
    .desktop-cart-icon {
        display: none;
    }

    .cart-icon-wrapper {
        font-size: 1rem;
    }

    #cart-count {
        font-size: 10px;
        padding: 1px 4px;
        min-width: 16px;
        height: 16px;
    }
}

/* Desktop Cart Notification - Keep Old Style */
@media (min-width: 768px) {
    .cart-notification-overlay {
        display: none !important;
    }
    
    .cart-notification {
        position: fixed;
        top: 20px;
        right: 20px;
        width: auto;
        height: auto;
        max-width: 400px;
        background: #5A3518;
        color: #f0f0f0;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        z-index: 10000;
        display: none;
        transform: none;
        transition: none;
        overflow: visible;
    }
    
    .cart-notification.show {
        display: block;
    }
    
    .cart-notification__content {
        padding: 20px;
        overflow: visible;
    }
    
    .cart-notification__header {
        border-bottom: none;
        margin-bottom: 15px;
        padding-bottom: 0;
    }
    
    .cart-notification__title {
        font-size: 16px;
        color: #f0f0f0;
    }
    
    .cart-notification__close {
        color: #f0f0f0;
        font-size: 24px;
    }
    
    .cart-notification__buttons {
        flex-direction: row;
        gap: 10px;
        padding: 0;
    }
    
    .cart-notification__button {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .cart-notification__button--secondary {
        background: transparent;
        color: #f0f0f0;
        border-color: #f0f0f0;
    }
}
