/* 
   AD Beauty Experience - Ecommerce Extensions
   Cart Sidebar & Auth Forms
*/

:root {
    --brand-rose-gold: #D4A5A5;
    --brand-rose-gold-dark: #C89595;
    --brand-black: #1a1a1a;
    --brand-white: #ffffff;
    --brand-gray-light: #f7f7f7;
    --brand-gray-dark: #666666;
    --font-heading: 'Playfair Display', serif;
}

/* Auth Modals */
.auth-modal {
    max-width: 450px !important;
}

.auth-form {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.auth-submit {
    background: var(--brand-black);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.auth-switch {
    font-size: 0.9rem;
    color: var(--brand-gray-dark);
    text-align: center;
    margin-top: 1rem;
}

.auth-switch span {
    color: var(--brand-rose-gold);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100%;
    background: white;
    z-index: 20000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #eee;
}

.cart-item-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.cart-item-price {
    font-weight: 600;
    color: var(--brand-rose-gold);
    font-size: 0.9rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
}

.cart-footer {
    padding: 2rem;
    border-top: 1px solid #eee;
    background: var(--brand-gray-light);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.checkout-btn {
    width: 100%;
    background: var(--brand-black);
    color: white;
    padding: 1.2rem;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
}

.checkout-btn:hover {
    background: #333;
}

.checkout-btn.btn-disabled {
    background: #ccc !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.cart-item.cart-item-no-stock {
    background: #fffafa;
    border: 1px dashed #ffcccc;
    padding: 10px;
    border-radius: 8px;
    opacity: 0.8;
}

.cart-item-no-stock h4 {
    color: #999;
}

/* User Profile Dropdown Sim */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    padding: 1rem 0;
    display: none;
    z-index: 1001;
    border-radius: 4px;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a,
.user-dropdown button {
    display: block;
    padding: 0.8rem 1.5rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.9rem;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--brand-gray-light);
    color: var(--brand-rose-gold);
}

@media (max-width: 500px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* Search Overlay (Refined for Pill Navbar) */
.search-overlay {
    position: absolute;
    top: calc(100% + 15px);
    left: 2.5vw;
    width: 95vw;
    max-width: 1200px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    z-index: 11000;
    padding: 1rem 0;
    display: none;
    border: 1px solid #eee;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-overlay.active {
    display: block;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-container {
    max-width: 800px !important;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f8f8;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    background: white;
    border-color: var(--brand-rose-gold);
    box-shadow: 0 0 0 4px rgba(212, 165, 165, 0.1);
}

.search-input-wrapper i {
    color: #999;
    margin-right: 15px;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.8rem 0;
    font-size: 1.1rem;
    outline: none;
    font-family: inherit;
}

.search-input-wrapper button#close-search {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding-left: 15px;
}

.search-input-wrapper button#close-search:hover {
    color: var(--brand-black);
}

/* --- Floating Toast Notification --- */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--brand-rose-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 1rem 2rem;
    border-radius: 8px;
    z-index: 20000;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none;
    min-width: 320px;
}

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

.toast-icon {
    color: var(--brand-rose-gold);
    font-size: 1.2rem;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--brand-black);
    margin: 0;
}

.toast-sub {
    font-size: 0.8rem;
    color: #888;
    margin: 2px 0 0 0;
}


/* --- Collection Page Layout --- */
.collection-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    padding: 3rem 0;
    align-items: start;
}

.collection-sidebar {
    grid-column: 1;
}

.collection-main {
    grid-column: 2;
}

@media (max-width: 992px) {
    .collection-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .collection-sidebar, .collection-main {
        grid-column: 1;
    }

    .collection-sidebar {
        display: block;
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        height: 100%;
        background: #fff;
        z-index: 12000;
        padding: 2rem;
        transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
        overflow-y: auto;
    }

    .collection-sidebar.active {
        left: 0;
    }

    .sidebar-mobile-toggle {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        background: #fff;
        border: 1px solid var(--brand-gray-light);
        padding: 1rem 1.2rem;
        margin-bottom: 1.5rem;
        cursor: pointer;
        font-weight: 700;
        letter-spacing: 1px;
        font-size: 0.9rem;
    }

    .collection-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 2rem;
    }

    .sort-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    
    .sort-select {
        flex: 1;
        max-width: 220px;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 11000;
        display: none;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .close-sidebar-mobile {
        display: block !important;
        position: absolute;
        top: 1rem;
        right: 1.5rem;
        font-size: 2.2rem;
        background: none;
        border: none;
        color: #333;
        cursor: pointer;
        z-index: 100;
    }
}

.sidebar-mobile-toggle {
    display: none;
}

.close-sidebar-mobile {
    display: none;
}

.filter-section {
    border-bottom: 1px solid var(--brand-gray-light);
    padding: 1.8rem 0;
}

.filter-section:first-child {
    padding-top: 0;
}

.filter-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--brand-black);
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    color: var(--brand-gray-dark);
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
}

.filter-item:hover {
    color: var(--brand-rose-gold);
}

.filter-item input[type="checkbox"] {
    accent-color: var(--brand-rose-gold);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.collection-header {
    margin-bottom: 2.5rem;
}

.collection-title-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 2rem;
}

.collection-title-row h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--brand-black);
    text-transform: capitalize;
}

.product-count {
    color: #999;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.collection-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1.2rem 0;
    border-top: 1px solid var(--brand-gray-light);
    border-bottom: 1px solid var(--brand-gray-light);
    margin-bottom: 3rem;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-wrapper label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--brand-black);
}

.sort-select {
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 1px solid var(--brand-gray-light);
    background: #fff;
    cursor: pointer;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1rem) center;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: #a0a0a0;
    margin-bottom: 2rem;
    font-weight: 500;
}

.breadcrumbs a {
    color: #666;
}

.breadcrumbs a:hover {
    color: var(--brand-rose-gold);
}

.breadcrumbs span::before {
    content: '/';
    color: #d0d0d0;
}

.breadcrumbs span {
    color: var(--brand-rose-gold);
    font-weight: 600;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    padding: 15px;
    overflow-y: auto; /* Allows scrolling if modal is taller than screen */
}

/* --- Product Detail Modal Redesign --- */
.product-detail-modal {
    max-width: 1000px !important;
    width: 100%;
    margin: auto;
    padding: 0 !important;
    background: #fff;
    border-radius: 12px;
    overflow: hidden; /* Kept for desktop, mobile override added below */
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #333;
    cursor: pointer;
    z-index: 100;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.product-detail-image-side {
    padding: 3rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #f0f0f0;
}

#modal-product-image {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    margin-bottom: 2rem;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.thumb {
    width: 60px;
    height: 60px;
    border: 1px solid #eee;
    padding: 5px;
    cursor: pointer;
}

.thumb.active {
    border-color: #333;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-detail-info-side {
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.modal-brand {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-rose-gold);
    /* Updated to brand color */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}

.modal-title {
    font-family: var(--font-heading);
    /* Use brand heading font */
    font-size: 1.8rem;
    line-height: 1.3;
    color: var(--brand-black);
    margin-bottom: 1.5rem;
}

.modal-price-container {
    margin-bottom: 2rem;
}

.modal-current-price {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--brand-black);
}

.modal-old-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-top: 5px;
}

.modal-size-selector {
    margin-bottom: 1.5rem;
}

.size-label {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.size-box {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f7f7f7;
    border: 1px solid #eee;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 4px;
}

.size-box.active {
    background: var(--brand-black);
    color: #fff;
    border-color: var(--brand-black);
}

/* Actions Row (Qty + Button) */
.modal-actions-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 3rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    background: #f7f7f7;
    border-radius: 50px;
    padding: 5px;
}

.quantity-selector button {
    width: 35px;
    height: 35px;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.quantity-selector button:hover {
    color: var(--brand-rose-gold);
}

#modal-qty-value {
    width: 30px;
    text-align: center;
    font-weight: 600;
}

.add-to-cart-premium.no-stock {
    background: #e0e0e0 !important;
    color: #888 !important;
    cursor: not-allowed;
    border: none;
}

.add-to-cart-premium {
    flex: 1;
    background: var(--brand-rose-gold);
    /* Updated to brand color */
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(212, 165, 165, 0.2);
}

.add-to-cart-premium:hover {
    background: var(--brand-rose-gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 165, 0.3);
}

.add-to-cart-premium:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.description-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #666;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 15px;
}

.description-text p {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .modal-overlay {
        align-items: flex-start; /* Better for tall scrolling modals */
        padding: 10px;
    }

    .product-detail-modal {
        margin: 10px auto;
        max-height: 94vh;
        overflow-y: auto !important;
        display: block; /* Simplifies layout */
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
    }

    .product-detail-image-side {
        padding: 1.5rem;
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    #modal-product-image {
        max-height: 220px; /* Reduced to leave more space for buttons */
        margin-bottom: 0.5rem;
    }

    .product-detail-info-side {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .modal-actions-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 1.5rem;
    }

    .quantity-selector {
        justify-content: center;
        background: #f0f0f0;
    }

    .add-to-cart-premium {
        padding: 1.1rem;
        font-size: 1rem;
    }

    .description-text {
        max-height: none; /* Let it expand since modal itself scrolls */
        overflow: visible;
        padding-right: 0;
    }
}