/*
    pages.css
    Page-specific styles: containers, sections, product cards, carousels
    Codex Studio - Minimalist Black & White Design
*/

/* ========== Main Container ========== */
.container {
    max-width: 1200px;
    margin: 28px auto;
    padding: 0 28px;
    width: 100%;
    overflow-x: hidden;
    max-width: 100vw;
}

.main-container {
    width: 100%;
    overflow-x: hidden;
    max-width: 100vw;
}

/* ========== Carousel / Hero Section ========== */
.hero {
    position: relative;
    overflow: visible;
    padding: 40px 0 16px;
}

.carousel {
    position: relative;
    width: 81%;
    height: 0;
    padding-bottom: 45.8%;
    overflow: visible;
    border-radius: 12px;
    z-index: 1;
    margin: 0 auto;
    box-shadow:
        -200px 0 200px -50px rgba(0, 0, 0, 0.15),
        200px 0 200px -50px rgba(0, 0, 0, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.1);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    overflow: hidden;
    border-radius: 12px;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel .slide svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Carousel navigation buttons */
.carousel-nav {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.carousel-nav:hover {
    opacity: 1;
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    left: auto;
    right: 20px;
}

/* Carousel navigation dots */
.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    z-index: 2;
    padding: 4px;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid #000;
    background: #fff;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.carousel-dots .dot:hover {
    transform: scale(1.1);
}

.carousel-dots .dot.active {
    background: #000;
}

.carousel-dots-right {
    left: auto !important;
    right: 20px !important;
    transform: none !important;
}

.carousel-dot-custom {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
}

/* ========== Products Grid (based on starred page) ========== */
.products-grid,
#productsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 240px)) !important;
    gap: 2rem;
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    justify-content: center;
}

/* Product card styles based on starred.html */
.product-card {
    width: 100%;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #000;
    text-decoration: none;
    position: relative;
}

.product-card:active {
    transform: scale(0.96) !important;
    opacity: 0.85;
}

.product-card-link {
    text-decoration: none;
    color: #000 !important;
    display: block;
}

.product-image-wrapper {
    width: 100%;
    position: relative;
}

.product-card img,
.product-image {
    width: 100%;
    height: 310px;
    object-fit: cover;
    border-radius: 6px;
    background: #f5f5f5;
}

.product-card-content {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card-title {
    margin: 0;
    font-size: 16px;
    color: #000 !important;
}

.product-card-price {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-weight: 400;
}

.product-info {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-info h4 {
    margin: 0;
    font-size: 16px;
}

.product-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Product checkbox (starred page) */
.product-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 15;
    accent-color: #000;
}

/* Star toggle button (starred page) */
.star-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.star-toggle:hover {
    transform: scale(1.1);
}

.star-toggle.starred svg path {
    fill: #000;
    stroke: #000;
}

.star-toggle svg {
    pointer-events: none;
}

/* Empty starred state */
.empty-starred {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.empty-starred h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #000;
}

.empty-starred p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Product section horizontal scroll style (index page) */
.products-horizontal {
    display: flex !important;
    gap: 20px !important;
    padding: 0 20px 20px 20px !important;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth !important;
}

/* Product section scrollbar style - Firefox */
@supports (scrollbar-width: auto) {
    .products-horizontal {
        scrollbar-width: auto !important;
        scrollbar-color: #666 #e0e0e0 !important;
    }
}

/* Product section scrollbar style - Webkit (Chrome, Safari, Edge) */
.products-horizontal::-webkit-scrollbar {
    height: 14px !important;
    -webkit-appearance: none !important;
    display: block !important;
}

.products-horizontal::-webkit-scrollbar-track {
    background: #e0e0e0 !important;
    border-radius: 8px !important;
    margin: 0 20px !important;
    display: block !important;
}

.products-horizontal::-webkit-scrollbar-thumb {
    background: #666 !important;
    border-radius: 8px !important;
    border: 2px solid #e0e0e0 !important;
    transition: background 0.3s ease !important;
    display: block !important;
}

.products-horizontal::-webkit-scrollbar-thumb:hover {
    background: #333 !important;
}

/* Product card width for horizontal scroll */
.products-horizontal .product-card {
    width: 240px;
    flex-shrink: 0;
}

.products-horizontal .product-card img,
.products-horizontal .product-card .product-image {
    width: 100%;
    height: 310px;
    object-fit: cover;
    border-radius: 6px;
    background: #f5f5f5;
}

/* Product section: Responsive grid layout - only for non-horizontal scroll */
.products:not(.products-horizontal) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
    max-width: 1400px;
}

.products-section {
    margin: 0.4rem 0;
}

/* ========== Category Header (starred, recently-viewed pages) ========== */
.category-header {
    text-align: center;
    padding: 120px 20px 40px;
    background: #f8f8f8;
}

.category-header-content {
    display: inline-block;
}

.category-header h1 {
    font-size: 48px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.category-header p {
    font-size: 18px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Batch actions (starred page) */
.batch-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.batch-action-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.batch-action-delete {
    background: #000;
    color: #fff;
}

.batch-action-delete:hover {
    background: #333;
}

.batch-action-delete:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.batch-action-clear {
    background: #f5f5f5;
    color: #000;
    border: 1px solid #ddd;
}

.batch-action-clear:hover {
    background: #eee;
}

.batch-actions-hidden {
    display: none;
}

/* ========== See More Button ========== */
.see-more-container,
.see-more-wrapper {
    text-align: center;
    margin: 2rem 0 3rem;
}

.see-more-link {
    display: inline-block;
    padding: 14px 40px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.see-more-link:hover {
    background: #333;
}

/* ========== About Us Section ========== */
.about,
.contact {
    margin-top: 48px;
    padding: 28px;
    border-top: 1px solid #f2f2f2;
}

.about {
    font-family: 'Gochi Hand', cursive;
    font-size: 1.5em;
    line-height: 1.6;
    padding: 40px;
    background: #fff;
    letter-spacing: 0.02em;
}

.about h2 {
    font-family: 'Gochi Hand', cursive;
    font-size: 2.4em;
    margin-bottom: 30px;
    letter-spacing: 0.04em;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.03);
}

.about p {
    margin-bottom: 25px;
    font-family: 'Gochi Hand', cursive;
    word-spacing: 0.1em;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.03);
}

.about-us-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-user-select: none;
    user-select: none;
}

.about-us-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.about-us-content {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.about-us-content.collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
}

.about-us-inner {
    overflow: hidden;
}

/* ========== Contact Section ========== */
.contact-website-link {
    color: #000;
    text-decoration: underline;
    display: inline-block;
    padding: 4px 2px;
    min-height: 44px;
    line-height: 36px;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.contact-website-link:hover,
.contact-website-link:active {
    color: #333;
    text-decoration-color: #333;
}

.contact-instagram-link {
    color: #000;
    text-decoration: underline;
    display: inline-block;
    padding: 4px 2px;
    min-height: 44px;
    line-height: 36px;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.contact-instagram-link:hover,
.contact-instagram-link:active {
    color: #333;
    text-decoration-color: #333;
}

/* ========== Product Page - Size Reference Tables ========== */
.size-reference {
    max-width: 900px;
    margin: 80px auto 0;
    padding: 0 24px;
}

.size-reference-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: 1px;
}

.size-category {
    margin-bottom: 50px;
}

.size-category-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #000;
}

.size-table thead tr {
    background-color: #000;
    color: #fff;
}

.size-table th {
    padding: 14px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #000;
}

.size-table td {
    padding: 12px;
    border: 1px solid #000;
}

.size-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ========== Hero All Products ========== */
.hero-all-products {
    padding: 3rem 1rem 2rem;
    text-align: center;
}

.hero-title {
    font-size: 2rem;
    margin: 0;
}

/* Filter pills centered */
.filter-pills-centered {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}

/* Products grid container */
.products-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ========== Order Pages Styles ========== */
.order-terms {
    font-size: 14px;
    color: #86868b;
    margin-top: 24px;
}

.email-status.hidden {
    display: none;
}

/* ========== Brand Title Link ========== */
.brand-title-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.topbar-sticky {
    z-index: 50;
}

/* ========== Responsive Design ========== */

/* Tablet */
@media (max-width:900px) {
    .topbar {
        padding: 12px 20px;
    }

    .brand {
        font-size: 24px;
    }

    .cart-drawer {
        width: 100%;
        right: -100%;
    }

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

    .side-menu {
        width: 280px;
    }

    .side-menu-footer {
        position: relative;
        margin-top: 32px;
        bottom: auto;
    }

    .carousel {
        width: 81%;
        padding-bottom: 45.8%;
        overflow: visible;
        box-shadow:
            -200px 0 200px -50px rgba(0, 0, 0, 0.15),
            200px 0 200px -50px rgba(0, 0, 0, 0.15),
            0 20px 60px rgba(0, 0, 0, 0.1);
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        padding: 20px;
    }

    .filter-pills {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Mobile */
@media (max-width:600px) {

    /* Overall scaling optimization */
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    .container {
        max-width: 100vw !important;
        width: 100% !important;
    }

    .topbar {
        padding: 8px 12px;
    }

    .brand {
        font-size: 16px;
        letter-spacing: 0.03em;
    }

    .icon-btn {
        padding: 4px;
        min-width: 36px;
        min-height: 36px;
    }

    .icon-btn svg {
        width: 16px;
        height: 16px;
    }

    .burger {
        width: 20px;
        height: 14px;
    }

    .side-menu {
        width: 100%;
        padding: 16px;
    }

    .side-menu-header {
        font-size: 20px;
        padding-bottom: 12px;
    }

    .side-menu-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .side-menu-nav a {
        font-size: 16px;
        padding: 10px 0;
    }

    /* Mobile: Make carousel as large as possible */
    .carousel {
        width: 100%;
        height: auto;
        padding-bottom: 142.384%;
        /* 161.8% * 0.88 = 142.384% */
    }

    .carousel-inner img {
        object-fit: cover;
    }

    .carousel-indicators {
        bottom: 8px;
    }

    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .products {
        gap: 15px !important;
        /* Horizontal scroll spacing */
        padding: 0 15px !important;
    }

    .products-horizontal .product-card {
        min-width: 180px !important;
        max-width: 180px !important;
        width: 180px !important;
    }

    .products-horizontal .product-card img,
    .products-horizontal .product-card .product-image {
        height: 227px !important;
        /* 324px * 0.7 = 227px */
    }

    .product-card {
        min-width: 180px !important;
        /* Smaller cards on mobile */
        max-width: 180px !important;
        padding: 0;
    }

    .product-card img,
    .product-card .product-image {
        height: 227px;
        /* 324px * 0.7 = 227px (scaled down 30%) */
        object-fit: cover;
        border-radius: 4px;
    }

    .product-card h3,
    .product-card .product-card-title {
        font-size: 16px;
        /* 17px * 0.95 = 16.15px (scaled down 5%) */
        margin: 4px 6px 3px;
        line-height: 1.2;
    }

    .product-card .price,
    .product-card .product-card-price {
        font-size: 11.5px;
        /* 10px * 1.15 = 11.5px (scaled up 15%) */
        margin: 0 6px 4px;
        font-weight: 400;
        color: #666;
    }

    /* Mobile: Horizontal scrolling filter pills */
    .filter-pills {
        overflow-x: auto !important;
        overflow-y: visible !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        padding: 0.5rem 0.8rem !important;
        margin: 1rem 0 0.4rem !important;
        scroll-snap-type: x proximity;
        display: flex !important;
        flex-direction: row !important;
        position: relative;
        z-index: 10;
    }

    @supports (scrollbar-width: none) {
        .filter-pills {
            scrollbar-width: none;
        }
    }

    .filter-pills::-webkit-scrollbar {
        display: none;
    }

    .pill {
        flex-shrink: 0 !important;
        scroll-snap-align: start;
        font-size: 11px !important;
        padding: 0.35rem 1rem !important;
        position: relative;
        z-index: 1;
    }

    .filter-pill {
        font-size: 11px;
        padding: 5px 10px;
        white-space: nowrap;
    }

    .cart-drawer {
        padding: 16px;
    }

    .cart-header {
        font-size: 20px;
        padding-bottom: 12px;
    }

    .cart-item {
        padding: 10px 0;
    }

    .cart-item-info h4 {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .cart-item-info p {
        font-size: 11px;
    }

    .cart-item .price {
        font-size: 14px;
    }

    .qty-controls {
        gap: 6px;
    }

    .qty-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .qty-display {
        font-size: 13px;
        min-width: 28px;
    }

    .cart-footer {
        padding: 12px 0;
        font-size: 14px;
    }

    .cart-footer .total {
        font-size: 18px;
    }

    .btn-checkout {
        padding: 12px 20px;
        font-size: 14px;
    }

    .search-box {
        width: calc(100vw - 24px);
        right: 4.5px;
        padding: 12px;
    }

    .search-box input {
        font-size: 16px;
        /* Prevent iOS zoom on focus */
        padding: 10px 12px;
    }

    .login-container {
        max-width: 90%;
        padding: 20px;
    }

    .login-container h2 {
        font-size: 22px;
    }

    .login-container input {
        font-size: 16px;
        /* Prevent iOS zoom on focus */
        padding: 10px 12px;
    }

    .login-container button {
        padding: 12px;
        font-size: 14px;
    }

    .oauth-btn {
        font-size: 14px;
        padding: 12px;
    }

    .about {
        font-size: 1.2em;
        padding: 20px;
        line-height: 1.8;
    }

    .about h2 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    .about p {
        margin-bottom: 20px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    #aboutUsContent {
        padding-bottom: 20px;
        max-height: none;
        overflow: visible;
    }

    .contact {
        padding: 20px;
    }

    .category-header {
        padding: 100px 20px 40px;
    }

    .category-header h1 {
        font-size: 32px;
    }

    .category-header p {
        font-size: 16px;
    }
}

@media (max-width: 768px) {

    /* Mobile: Smaller carousel dots */
    .carousel-dots .dot {
        width: 6px !important;
        height: 6px !important;
        border-width: 1px !important;
    }

    .carousel-dots {
        gap: 6px !important;
        bottom: 15px !important;
        left: 15px !important;
    }

    /* Mobile product grid - show two columns */
    .products-grid,
    #productsGrid,
    .products:not(.products-horizontal) {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 12px !important;
        margin: 1rem auto !important;
    }

    /* Adjust product card size on mobile */
    .product-card {
        padding: 10px;
        border-radius: 8px;
    }

    /* This is overridden by more specific selectors below */
    .product-info h4 {
        font-size: 14px;
    }

    .product-info p {
        font-size: 12px;
    }

    .add-btn {
        padding: 8px;
        font-size: 13px;
    }

    .footer {
        padding: 32px 16px;
        margin-top: 60px;
    }

    .footer-links {
        font-size: 0.9em;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .footer-separator {
        display: none;
    }

    .footer-copyright {
        font-size: 0.85em;
    }

    .privacy-content {
        padding: 24px;
        max-width: 95%;
        margin: 0 auto;
    }

    .privacy-content h1 {
        font-size: 1.5em;
    }

    .privacy-content h2 {
        font-size: 1.2em;
    }

    /* Privacy Modal responsive */
    .privacy-content>div[style*="grid"] {
        display: block !important;
    }

    .privacy-content aside {
        margin-top: 24px;
    }
}

@media (max-width: 480px) {
    .privacy-content {
        padding: 20px 16px;
    }

    .privacy-content h1 {
        font-size: 1.3em;
    }

    #closePrivacyModal {
        top: 8px;
        right: 8px;
        font-size: 24px;
    }

    /* Smaller screens: Even smaller dots */
    .carousel-dots .dot {
        width: 5px !important;
        height: 5px !important;
        border-width: 1px !important;
    }

    .carousel-dots {
        gap: 5px !important;
    }
}