/* ============================================
   Photography Art Theme — Responsive Overrides
   Loaded AFTER photographyart-theme.css and generic CSS
   to ensure these rules take priority.
   ============================================ */

/* ─── Body scroll lock when mobile menu is open ─── */
body.menu-open {
    overflow: hidden;
}

/* ─── Mobile Menu Backdrop Overlay ─── */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.mobile-menu-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}


/* ============================================
   TABLET (max-width: 1023px)
   ============================================ */
@media (max-width: 1023px) {

    /* ─── Header ─── */
    .header-container {
        padding: 1rem 1.5rem;
    }

    .header-nav {
        position: static;
        transform: none;
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .nav-menu {
        gap: 1.5rem !important;
    }

    .nav-menu a {
        font-size: 0.8rem !important;
        letter-spacing: 0.08em;
    }

    /* ─── Product Detail ─── */
    .product-container {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
    }

    .product-main-image {
        height: 450px !important;
    }

    /* ─── About page ─── */
    .about-content {
        gap: var(--spacing-lg);
    }

    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ─── Contact page ─── */
    .map-container {
        height: 350px;
    }
}


/* ============================================
   MOBILE (max-width: 767px)
   ============================================ */
@media (max-width: 767px) {

    /* ─── Show backdrop ─── */
    .mobile-menu-backdrop {
        display: block;
    }

    /* ─── Header: remove ALL stacking contexts so fixed nav-menu can escape ─── */
    /* position:sticky ALWAYS creates a stacking context, so we must remove it when menu is open */
    .header {
        z-index: auto !important;
    }

    body.menu-open .header {
        position: relative !important;
    }

    .header-container {
        position: relative;
        z-index: auto !important;
        background: var(--color-background, #fff);
    }

    .header-nav {
        position: static !important;
        transform: none !important;
        z-index: auto !important;
    }

    /* ─────────────────────────────────────────
       PREMIUM MOBILE MENU — Dark Slide-in Drawer
       ───────────────────────────────────────── */
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        left: auto !important;
        right: -100%;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        background: var(--color-primary, #2c2c2c) !important;
        flex-direction: column;
        align-items: stretch;
        padding: 0 !important;
        gap: 0 !important;
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.3);
        z-index: 99999 !important;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .nav-menu.active {
        right: 0 !important;
        left: auto !important;
    }

    /* Menu header area */
    .nav-menu::before {
        content: 'MENU';
        display: block;
        padding: 2rem 1.75rem 1.25rem;
        font-family: var(--font-heading, 'Playfair Display', serif);
        font-size: 0.8rem;
        letter-spacing: 0.25em;
        color: var(--color-accent, #c9a961);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Menu links */
    .nav-menu li {
        list-style: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        width: 100%;
    }

    .nav-menu a {
        display: block !important;
        color: #ffffff !important;
        font-size: 0.95rem !important;
        line-height: 1.5;
        padding: 1rem 1.75rem !important;
        font-family: var(--font-body, 'Lato', sans-serif);
        text-transform: uppercase;
        letter-spacing: 0.12em;
        width: 100%;
        background: transparent;
        transition: all 0.25s ease;
        text-decoration: none;
    }

    .nav-menu a::after {
        display: none !important;
    }

    .nav-menu a:hover,
    .nav-menu a:focus {
        color: #c9a961 !important;
        opacity: 1 !important;
        background: rgba(255, 255, 255, 0.06) !important;
        padding-left: 2.25rem !important;
    }

    /* ─── Animated Hamburger Icon ─── */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 28px;
        height: 28px;
        background: none !important;
        border: none !important;
        cursor: pointer;
        padding: 0;
        gap: 5px;
        position: relative;
        z-index: 1002;
    }

    .hamburger-line {
        display: block;
        width: 22px;
        height: 2px;
        background-color: var(--color-text, #2c2c2c);
        border-radius: 2px;
        transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
        transform-origin: center;
    }

    /* Hamburger → X animation */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }


    /* ─── Mobile Submenu Accordion ─── */
    .nav-item-dropdown {
        position: relative;
        width: 100%;
    }

    .nav-item-dropdown .nav-link-dropdown {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .nav-item-dropdown .nav-link-dropdown i {
        transition: transform 0.3s ease;
        font-size: 0.6rem !important;
        opacity: 0.5;
        margin-left: auto;
        margin-right: 0;
    }

    .nav-item-dropdown.submenu-open .nav-link-dropdown i {
        transform: rotate(180deg);
        opacity: 1;
        color: var(--color-accent, #c9a961);
    }

    .nav-submenu {
        position: static !important;
        display: none !important;
        box-shadow: none !important;
        border: none !important;
        min-width: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        margin-top: 0 !important;
        background: rgba(0, 0, 0, 0.15) !important;
    }

    .nav-item-dropdown:hover .nav-submenu {
        display: none !important;
    }

    .nav-submenu.open,
    .nav-item-dropdown .nav-submenu.open,
    .nav-item-dropdown:hover .nav-submenu.open,
    .nav-item-dropdown.submenu-open .nav-submenu {
        display: block !important;
    }

    .nav-submenu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    }

    .nav-submenu li:last-child {
        border-bottom: none !important;
    }

    .nav-submenu li a,
    .nav-submenu a {
        padding: 0.75rem 1.75rem 0.75rem 2.5rem !important;
        font-size: 0.82rem !important;
        letter-spacing: 0.08em !important;
        color: #fff !important;
        opacity: 0.65;
    }

    .nav-submenu li a:hover,
    .nav-submenu a:hover {
        color: #c9a961 !important;
        opacity: 1;
        padding-left: 3rem !important;
        background: rgba(255, 255, 255, 0.03) !important;
    }


    /* ─── Hero section text fix ─── */
    .hero-content p {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: 1.5;
    }

    .hero-content h1 {
        white-space: normal;
        line-height: 1.2;
    }

    /* ─── Product Detail ─── */
    .product-container {
        grid-template-columns: 1fr;
    }

    .product-main-image {
        height: 350px !important;
    }

    .product-title {
        font-size: 1.8rem;
    }

    .product-thumbnails {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .product-thumbnail {
        width: 70px !important;
        height: 70px !important;
    }

    .product-meta {
        grid-template-columns: 1fr;
    }

    .product-actions {
        flex-direction: column;
    }

    .product-actions .btn {
        width: 100%;
    }

    /* ─── Products Listing ─── */
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1002;
        background: var(--color-background);
        overflow-y: auto;
        transition: left 0.3s ease;
        padding: 1.5rem;
        box-shadow: var(--shadow-lg);
    }

    .filters-sidebar.active {
        left: 0;
    }

    .mobile-filters-toggle {
        display: block !important;
    }

    .price-input {
        width: 70px !important;
    }

    /* ─── Cart ─── */
    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns: 100px 1fr;
        gap: var(--spacing-sm);
    }

    .cart-item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        margin-top: var(--spacing-sm);
    }

    .cart-item-image {
        height: 120px;
    }

    .cart-item-title {
        font-size: 1.1rem;
    }

    /* ─── Checkout: Compact mobile card layout ─── */
    .photography-art-checkout .checkout-products-card {
        overflow-x: hidden !important;
        padding: 0.5rem !important;
    }

    .photography-art-checkout .table-responsive {
        overflow: visible !important;
    }

    .photography-art-checkout .checkout-table {
        min-width: 0 !important;
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .photography-art-checkout .checkout-table thead {
        display: none !important;
    }

    /* Each row = flex wrap: image + name on first line, price info below */
    .photography-art-checkout .checkout-table tbody tr {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        padding: 0.6rem 0 !important;
        border: none !important;
        border-bottom: 1px solid var(--color-border, #e5e5e5) !important;
        border-radius: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    .photography-art-checkout .checkout-table tbody tr:last-child {
        border-bottom: none !important;
    }

    .photography-art-checkout .checkout-table tbody tr td {
        border: none !important;
        padding: 0 !important;
    }

    .photography-art-checkout .checkout-table tbody tr td::before {
        display: none !important;
    }

    /* Image — fixed width */
    .photography-art-checkout .checkout-table tbody tr td:nth-child(1) {
        flex: 0 0 65px !important;
        display: block !important;
    }

    .photography-art-checkout .checkout-product-image {
        width: 58px !important;
        height: 58px !important;
        border-radius: 6px !important;
    }

    /* Product name — fills remaining space */
    .photography-art-checkout .checkout-table tbody tr td:nth-child(2) {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        display: block !important;
        padding-top: 0.1rem !important;
    }

    .photography-art-checkout .checkout-table tbody tr td:nth-child(2) .checkout-product-name strong {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        display: block !important;
        word-wrap: break-word !important;
    }

    .photography-art-checkout .checkout-table tbody tr td:nth-child(2) .product-variant-info {
        margin-top: 0.15rem !important;
        gap: 0.25rem !important;
    }

    .photography-art-checkout .checkout-table tbody tr td:nth-child(2) .product-variant-info .variant-attr {
        font-size: 0.7rem !important;
        padding: 0.1rem 0.3rem !important;
    }

    /* Price/Qty/Total — full width row below, displayed inline */
    .photography-art-checkout .checkout-table tbody tr td:nth-child(3) {
        flex: 0 0 auto !important;
        display: block !important;
        margin-left: 65px !important;
        margin-top: 0.25rem !important;
        font-size: 0.82rem !important;
        color: var(--color-text-light, #666) !important;
        font-weight: 400 !important;
    }

    .photography-art-checkout .checkout-table tbody tr td:nth-child(4) {
        flex: 0 0 auto !important;
        display: block !important;
        margin-top: 0.25rem !important;
        font-size: 0.82rem !important;
        color: var(--color-text-light, #666) !important;
        font-weight: 400 !important;
    }

    .photography-art-checkout .checkout-table tbody tr td:nth-child(5) {
        flex: 1 1 auto !important;
        display: block !important;
        text-align: right !important;
        margin-top: 0.25rem !important;
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        color: var(--color-primary, #2c2c2c) !important;
    }

    /* Qty: show as "× 1" */
    .photography-art-checkout .checkout-table tbody tr td.checkout-quantity .quantity-display::before {
        content: '× ';
    }

    /* Hide remove button on checkout */
    .photography-art-checkout .checkout-table tbody tr td.checkout-quantity .btn-remove-item {
        display: none !important;
    }

    /* Separators between price · qty = total */
    .photography-art-checkout .checkout-table tbody tr td.checkout-price::after {
        content: ' · ' !important;
        color: var(--color-text-light, #999) !important;
        font-weight: 300 !important;
    }

    .photography-art-checkout .checkout-table tbody tr td.checkout-quantity::after {
        content: ' = ' !important;
        color: var(--color-text-light, #999) !important;
        font-weight: 300 !important;
    }

    /* Order summary */
    .photography-art-checkout .checkout-summary {
        padding-top: var(--spacing-sm) !important;
        margin-top: var(--spacing-sm) !important;
    }

    .photography-art-checkout .checkout-summary .summary-row {
        font-size: 0.9rem;
    }

    .photography-art-checkout .checkout-summary .summary-total-row {
        font-size: 1.1rem !important;
    }

    /* Form cards */
    .photography-art-checkout .checkout-form-card {
        padding: var(--spacing-md) !important;
    }

    .photography-art-checkout .checkout-form-card .form-section-title {
        font-size: 1.25rem !important;
    }

    .photography-art-checkout .row.g-4 {
        gap: 0 !important;
    }

    .photography-art-checkout .col-lg-4 {
        margin-bottom: var(--spacing-sm);
    }

    /* Coupon input stack on mobile */
    .photography-art-checkout .input-group {
        flex-direction: column !important;
    }

    .photography-art-checkout .input-group .btn {
        width: 100%;
    }

    /* Checkout page title */
    .photography-art-checkout .page-title {
        font-size: 1.8rem !important;
        margin-bottom: var(--spacing-md) !important;
    }

    /* Name/city/zip side-by-side rows stack on mobile */
    .photography-art-checkout .checkout-form-card .row {
        flex-direction: column !important;
    }

    /* ─── About ─── */
    .about-content {
        grid-template-columns: 1fr !important;
    }

    .about-image {
        height: 300px !important;
    }

    .values-grid {
        grid-template-columns: 1fr !important;
    }

    .team-grid {
        grid-template-columns: 1fr !important;
    }

    .team-member-link img {
        width: 140px !important;
        height: 140px !important;
    }

    /* ─── Contact ─── */
    .contact-content {
        grid-template-columns: 1fr !important;
    }

    .map-container {
        height: 280px;
    }

    /* ─── Artists ─── */
    .artist-profile-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .artist-profile-image {
        width: 200px;
        height: 200px;
    }

    .artist-profile-name {
        font-size: 2rem;
    }

    /* ─── Page Headers ─── */
    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    /* ─── Newsletter ─── */
    .newsletter-form {
        flex-direction: column;
        gap: 1rem;
    }

    .newsletter-input,
    .newsletter-btn {
        width: 100%;
    }

    /* ─── Quick View Modal ─── */
    .quick-view-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .quick-view-product {
        grid-template-columns: 1fr;
    }

    .quick-view-actions {
        flex-direction: column;
    }

    /* ─── Footer ─── */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .footer {
        padding: var(--spacing-lg) 0 var(--spacing-md);
    }
}


/* ============================================
   SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {

    /* ─── Header icons ─── */
    .header-actions {
        gap: 0.4rem;
    }

    .header-icon {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.85rem;
    }

    .cart-count {
        font-size: 0.6rem;
        min-width: 14px;
        height: 14px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo img {
        max-height: 32px !important;
    }

    .header-container {
        padding: 0.75rem 0.75rem;
    }

    /* ─── Mobile menu smaller screens ─── */
    .nav-menu {
        width: 270px;
    }

    .nav-menu::before {
        padding: 1.5rem 1.25rem 1rem;
    }

    .nav-menu a {
        padding: 0.85rem 1.25rem !important;
        font-size: 0.85rem !important;
    }

    /* ─── Hero ─── */
    .hero-section {
        height: 55vh;
        min-height: 350px;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    /* ─── Product Detail ─── */
    .product-main-image {
        height: 250px !important;
    }

    .product-thumbnail {
        width: 55px !important;
        height: 55px !important;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .quantity-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .quantity-input {
        width: 60px !important;
    }

    /* ─── Artwork Grid ─── */
    .artwork-image {
        height: 260px;
    }

    .collection-card {
        height: 300px;
    }

    /* ─── Cart ─── */
    .cart-item {
        grid-template-columns: 80px 1fr;
    }

    .cart-item-image {
        height: 90px;
    }

    .cart-item-title {
        font-size: 1rem;
    }

    .cart-item-price {
        font-size: 1rem;
    }

    .quantity-control {
        padding: 0.2rem;
    }

    .quantity-control .quantity-btn {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }

    .quantity-control .quantity-input {
        width: 40px;
        font-size: 0.85rem;
    }

    .coupon-input {
        flex-direction: column;
    }

    .coupon-input .btn-apply-coupon {
        width: 100%;
    }

    /* ─── Checkout ─── */
    .photography-art-checkout .checkout-products-card {
        padding: 0.25rem !important;
    }

    .photography-art-checkout .checkout-table tbody tr td:nth-child(1) {
        flex: 0 0 55px !important;
    }

    .photography-art-checkout .checkout-product-image {
        width: 50px !important;
        height: 50px !important;
    }

    .photography-art-checkout .checkout-table tbody tr td:nth-child(3) {
        margin-left: 55px !important;
    }

    .photography-art-checkout .checkout-table tbody tr {
        padding: 0.5rem 0 !important;
    }

    .photography-art-checkout .checkout-form-card {
        padding: var(--spacing-sm) !important;
    }

    .photography-art-checkout .checkout-form-card .form-section-title {
        font-size: 1.1rem !important;
    }

    .photography-art-checkout .checkout-form-card .form-control,
    .photography-art-checkout .checkout-form-card .form-select {
        padding: 0.65rem !important;
        font-size: 0.9rem !important;
    }

    .photography-art-checkout .page-title {
        font-size: 1.5rem !important;
    }

    .photography-art-checkout .checkout-summary .summary-total-row {
        font-size: 1rem !important;
    }

    /* ─── About ─── */
    .about-image {
        height: 220px !important;
    }

    .team-member-link img {
        width: 100px !important;
        height: 100px !important;
    }

    .value-card {
        padding: var(--spacing-md);
    }

    /* ─── Contact ─── */
    .map-container {
        height: 220px;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.75rem;
    }

    /* ─── Artists ─── */
    .artist-avatar {
        width: 120px;
        height: 120px;
    }

    .artist-name {
        font-size: 1.4rem;
    }

    .artist-profile-image {
        width: 150px;
        height: 150px;
    }

    .artist-profile-name {
        font-size: 1.6rem;
    }

    /* ─── Buttons ─── */
    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
    }

    /* ─── Sections ─── */
    .section {
        padding: var(--spacing-md) 0;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 0.75rem;
    }
}


/* ============================================
   EXTRA SMALL (max-width: 375px)
   ============================================ */
@media (max-width: 375px) {

    .header-actions {
        gap: 0.3rem;
    }

    .header-icon {
        width: 1.4rem;
        height: 1.4rem;
        font-size: 0.8rem;
    }

    .logo {
        font-size: 1rem;
    }

    .hero-content h1 {
        font-size: 1.3rem;
    }

    .hero-content p {
        font-size: 0.85rem;
    }

    .cart-item {
        grid-template-columns: 70px 1fr;
    }

    .cart-item-image {
        height: 70px;
    }

    .nav-menu {
        width: 250px;
    }
}
