/*
Theme Name: Slumbelry Christmas
Theme URI: https://slumbelry.com/
Description: A modern, elegant theme for Slumbelry, tailored for the European market. Responsive, SEO-friendly, and pixel-perfect.
Author: Cassie Moreau
Author URI: https://slumbelry.com/
Version: 1.0.0
License: GPL v2 or later
Text Domain: slumbelry
*/

/* 
   Hide MailPoet Popup for:
   1. Logged-in Users
   2. Specific "No Popup" Pages (Cart, Checkout, etc.)
*/
body.logged-in .mailpoet_form_popup_overlay,
body.logged-in .mailpoet_form_slide_in_overlay,
body.no-mailpoet-popup .mailpoet_form_popup_overlay,
body.no-mailpoet-popup .mailpoet_form_slide_in_overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* 
   MailPoet Form Customization - Simplified (Email Only)
   Hiding Name fields to reduce friction as requested.
*/
.mailpoet_paragraph_fname,
.mailpoet_paragraph_lname,
.mailpoet_text_field[name="data[form_field_first_name]"],
.mailpoet_text_field[name="data[form_field_last_name]"],
.mailpoet_paragraph:has(input[name*="first_name"]),
.mailpoet_paragraph:has(input[name*="last_name"]) {
    display: none !important;
}

/* 
   MailPoet Popup Mobile Optimization
   Fixes the "broken background image" issue on small screens.
*/
@media (max-width: 768px) {
    /* 1. Reset background image to solid color */
    .mailpoet_form_popup .mailpoet_form, 
    .mailpoet_form_slide_in .mailpoet_form,
    #mailpoet_form_1 .mailpoet_form {
        background-image: none !important;
        background-color: #a7d7c5 !important; /* Your brand deep green */
        padding: 30px 20px !important; /* Give content some breathing room */
    }

    /* 2. Stack content vertically */
    .mailpoet_form_column {
        width: 100% !important;
        flex-basis: 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px;
    }

    /* 3. Ensure text is readable and centered */
    .mailpoet_form_popup h2,
    .mailpoet_form_popup p,
    .mailpoet_form_popup .mailpoet_message {
        text-align: center !important;
        color: #ffffff !important; /* Ensure white text on dark background */
    }
}

body {
  font-family: 'Inter', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  color: #546d63;
  background: #f5f6f4;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevent horizontal scroll globally */
  width: 100%;
  position: relative;
}

html {
  overflow-x: hidden; /* Double lock for mobile browsers */
  width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  color: #2d3a35;
  font-family: 'Inter', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

.site-header, .site-footer {
  background: #f5f6f4;
}

a {
  color: #3b7c6e;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover, a:focus {
  color: #1e4d3a;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.mobile-only { display: none; }
@media (max-width: 1024px) {
  .mobile-only { display: block !important; }
}
.desktop-only { display: block; }
@media (max-width: 1024px) {
  .desktop-only { display: none !important; }
}

/* Article Page Specific Styles */
.page-template-page-article-best-sleep-apps-review .article-content {
  max-width: 65% !important;
}

.page-template-page-article-best-sleep-apps-review .content-card {
  border-left: 4px solid #4A5A52 !important;
  border-bottom: 2px solid #4A5A52 !important;
}

.page-template-page-article-best-sleep-apps-review .conclusion-section {
  border-top: 2px solid #4A5A52 !important;
}

.page-template-page-article-best-sleep-apps-review .related-articles {
  border-top: 2px solid #4A5A52 !important;
}

/* Hide Google reCAPTCHA badge (Compliance: Google Terms added in Footer) */
/* Moved to consolidated rule below */

/* 
   MOBILE OPTIMIZATION - Cassie's Adjustments
   Target: Max-width 768px (Standard Mobile)
*/
@media (max-width: 768px) {
  /* 1. Global Container Padding Reset to 3px (except Banner) */
  .container:not(.subscribe-banner .container) {
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  /* 2. Subscribe Page Card Width Expansion */
  .subscribe-form-wrapper,
  .subscribe-benefits,
  .subscribe-form-container {
     width: 100% !important;
     max-width: 100% !important;
     margin-left: 0 !important;
     margin-right: 0 !important;
     box-sizing: border-box !important;
  }
  
  /* 3. Article Page Content Width Expansion */
  .page-template-page-article-best-sleep-apps-review .article-content {
    max-width: 100% !important;
    padding: 10px !important;
  }

  /* 4. Fix Mobile Font Sizes */
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  p { font-size: 16px !important; line-height: 1.5 !important; }
  
  /* 5. Improve Button Tap Targets */
  button, 
  .button,
  input[type="submit"] {
    min-height: 44px;
    padding: 12px 20px;
  }
}

/* 
   WOOCOMMERCE ACCOUNT PAGE OPTIMIZATION
   Making the dashboard cleaner and more modern.
*/
.woocommerce-account .woocommerce-MyAccount-navigation {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li:last-child {
    border-bottom: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 10px 15px;
    color: #2d3a35;
    font-weight: 500;
    transition: all 0.2s ease;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    background: #f5f6f4;
    color: #3b7c6e;
    padding-left: 20px; /* Slide effect */
}

.woocommerce-account .woocommerce-MyAccount-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.woocommerce-account .u-column1, 
.woocommerce-account .u-column2 {
    width: 100%; /* Stack columns on login/register */
    padding: 0;
    margin-bottom: 20px;
}

/* Form Inputs Modernization */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus {
    border-color: #3b7c6e;
    background: #fff;
    outline: none;
}

button.button.woocommerce-Button {
    background-color: #3b7c6e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
}

button.button.woocommerce-Button:hover {
    background-color: #2a5a50;
}

/* 
   ULTIMATE MEMBER (UM) OVERRIDES 
   Ensure UM blends perfectly with our theme.
*/
.um-field-label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #2d3a35;
}

.um-form input[type=text], 
.um-form input[type=password], 
.um-form input[type=email] {
    border-radius: 4px !important;
    border: 1px solid #ddd !important;
    padding: 0 12px !important;
    height: 44px !important;
}

.um-form input:focus {
    border-color: #3b7c6e !important;
    box-shadow: 0 0 0 2px rgba(59, 124, 110, 0.1) !important;
}

/* Base button styles - Overridden below for specific colors */
.um .um-button {
    border-radius: 4px !important;
    transition: background 0.2s !important;
}

/* Hide grecaptcha badge but keep functionality (User agreed to terms) */
.grecaptcha-badge { 
    visibility: hidden; 
}

/* 
   --------------------------------------------------------------------------
   UM Profile Navigation & Global Button Updates (User Request 2026-01-07)
   --------------------------------------------------------------------------
*/

/* 1. Profile Navigation Tabs (About, Posts, Comments, Orders) */
/* Container Bar */
.um-profile-nav {
    background: #2d3a35 !important;
    border-bottom: none !important;
}

/* Individual Tab Items */
.um-profile-nav-item a {
    color: #F5F6F4 !important; /* Inactive Text Color */
    background: transparent !important;
    border: none !important;
    font-weight: 500;
    opacity: 0.8;
}

.um-profile-nav-item a:hover {
    opacity: 1;
    color: #F5F6F4 !important;
}

/* Active State - The "Button" Look */
.um-profile-nav-item.active a {
    background-color: #2a5a50 !important; /* User requested background */
    color: #F5F6F4 !important; /* User requested text */
    opacity: 1;
}

/* Icons in Tabs */
.um-profile-nav-item i {
    color: #F5F6F4 !important;
}

/* 2. Global UM Action Buttons (Confirm, Upload, Save, Register) - Overrides */
/* This covers all main action buttons in UM forms */
.um .um-button,
.um input[type="submit"].um-button,
.um a.um-button,
.um-field-file .um-button,
.um .um-button.um-register-btn,
.um .um-button.um-save-profile-btn {
    background-color: #2a5a50 !important; /* Primary Brand Color */
    color: #F5F6F4 !important; /* Off-white Text */
}

.um .um-button:hover,
.um input[type="submit"].um-button:hover,
.um a.um-button:hover,
.um-field-file .um-button:hover,
.um .um-button.um-register-btn:hover,
.um .um-button.um-save-profile-btn:hover {
    background-color: #1e4d3a !important; /* Darker on hover */
    color: #F5F6F4 !important;
}

/* 
   HUBSPOT CHAT VISIBILITY FIX 
   Ensure chat widget is always on top and visible across all devices/OS.
*/
#hubspot-messages-iframe-container {
    display: block !important;
    z-index: 2147483647 !important; /* Max safe integer */
    visibility: visible !important;
    opacity: 1 !important;
}

iframe[id^="hubspot-messages-iframe"] {
    display: block !important;
    visibility: visible !important;
}

/* Desktop-specific Enforcement */
@media (min-width: 1025px) {
    #hubspot-messages-iframe-container {
        display: block !important;
        visibility: visible !important;
        z-index: 2147483647 !important;
    }
}

/* =========================================
   SINGLE PRODUCT PAGE PRICING STYLES
   (Replaces previous inline styles for better responsiveness)
   ========================================= */

/* Base Styles (Desktop Default > 1350px) - Compact & Bold */
.price-breakdown {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 85px; /* Reduced height to minimize whitespace */
    padding-right: 130px; /* Slightly tighter reservation */
}

.price-breakdown.no-discount {
    padding-right: 0;
    align-items: center;
    text-align: center;
    min-height: auto;
}

.price-stack {
    display: flex;
    flex-direction: column;
    gap: 2px; /* Tighter gap between prices */
}

/* 
     Important: Using !important to override potential theme conflicts
     Colors: #4A5A52 (Green) for Sale, #E57373 (Red) for Original
     Font Size: Using clamp() for smooth proportional scaling between Tablet and Desktop
  */
  .sale-price {
       display: block;
       color: #4A5A52 !important; /* Force Green */
       font-size: clamp(17px, 2.5vw, 44px) !important; /* Aggressive scaling: reduced by ~30% */
       font-weight: 800; /* Extra Bold */
       line-height: 1;
       letter-spacing: -0.5px;
       white-space: nowrap; /* Prevent wrapping */
       max-width: 100%;
   }
   
   .original-price {
       display: block;
       color: #E57373 !important; /* Force Red */
       text-decoration: line-through;
       font-size: clamp(12px, 1.2vw, 22px) !important; /* Reduced by ~30% */
       font-weight: 600; /* Semi-bold */
       line-height: 1;
       opacity: 0.8;
   }
   
   .current-price {
       display: inline-block;
       color: #4A5A52 !important;
       font-size: clamp(18px, 2.8vw, 48px) !important; /* Reduced by ~30% */
       font-weight: 800;
       white-space: nowrap;
       max-width: 100%;
   }

/* Discount Panel - Absolute Positioned (Right Aligned) */
.discount-panel {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px; /* Tighter vertical spacing */
    z-index: 10;
}

.sale-label {
    padding: 4px 12px; /* Reduced padding */
    background: #C7B198;
    color: #F5F6F4;
    border-radius: 8px; /* Slightly sharper corners */
    font-weight: 800; /* Extra Bold */
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discount-percent {
    font-weight: 800; /* Extra Bold */
    font-size: 20px; /* Larger impact */
    color: #E57373;
    line-height: 1;
}

.discount-save {
    font-weight: 700;
    font-size: 14px;
    color: #E57373;
    white-space: nowrap;
}

.mobile-price-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    margin-top: 4px; /* Pull closer to main price */
    padding-top: 4px;
    border-top: 1px solid rgba(0,0,0,0.03); /* Subtle separation */
}

/* 
   RESPONSIVE FIX: Tablet / Narrow Desktop (769px - 1350px)
   Strategy: Proportional Scaling (Zoom) to fit narrow screens
*/
@media screen and (min-width: 769px) and (max-width: 1350px) {
    .discount-panel {
        /* Scale down proportionally but keep position tight */
        transform: translateY(-50%) scale(0.85);
        transform-origin: right center;
        right: 0;
    }

    .price-breakdown {
        /* Reduce padding to match the scaled panel width */
        padding-right: 110px;
        min-height: 75px; /* Even tighter on smaller screens */
    }
    
    .sale-price {
        font-size: 40px;
    }
    
    /* Quantity Selector Overflow Fix */
    .quantity-selector {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
        width: 100%;
    }
    
    .quantity-selector .quantity-controls {
        width: auto;
        flex-shrink: 0;
        display: flex;
    }
    
    .quantity-selector .qty-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    
    .quantity-selector input#quantity {
        width: 50px;
        min-width: 50px;
    }
}

/* =========================================
   PRODUCT CARD STYLES (Aligning with Homepage)
   ========================================= */

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
}

.product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    background-color: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
    background-color: #fff; /* Fix for transparent PNGs overlapping */
}

.product-img.hover-img {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 10;
}

.product-card:hover .product-img.hover-img {
    opacity: 1;
}

.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 20;
}

.card-badges .badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 999px;
    line-height: 1.2;
    color: #2d3a35;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-badges .badge.new {
    background: #C7B198; /* Brand Gold */
    color: #ffffff;
}

.card-badges .badge.featured {
    background: #4A5A52;
    color: #ffffff;
}

.card-badges .badge.sale {
    display: none; /* Sale badge removed */
}

.product-info h3 {
    font-family: 'Playfair Display', serif; /* Assuming serif font from homepage */
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.product-info h3 a {
    color: #2d3a35;
    text-decoration: none;
    transition: color 0.2s;
}

.product-info h3 a:hover {
    color: #3b7c6e;
}

.add-to-cart-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2d3a35;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
}

.add-to-cart-btn:hover {
    background-color: #3b7c6e;
    color: white;
}

.add-to-cart-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* =========================================
   PRODUCT GRID LAYOUT (Responsive) - NEW ADDITION
   ========================================= */

.products-grid,
.new-arrivals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* Tablet (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    .products-grid,
    .new-arrivals-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    .products-grid,
    .new-arrivals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-card {
        margin-bottom: 0; /* Let grid gap handle spacing */
    }
    
    .product-info h3 {
        font-size: 14px; /* Smaller title on mobile */
    }
    
    .product-price {
        font-size: 14px;
    }
    
    .add-to-cart-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Load More Button Styling */
.load-more-section {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 60px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: #2d3a35;
    font-weight: 500;
    margin-bottom: 10px;
}

.section-header p {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

.load-more-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: transparent;
    color: #2d3a35;
    border: 1px solid #2d3a35;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background-color: #2d3a35;
    color: white;
}

/* =========================================
   LANDSCAPE WARNING FIX
   ========================================= */
#landscape-warning {
    display: none !important;
}

@media only screen and (max-width: 1000px) and (max-height: 600px) and (orientation: landscape) {
    #landscape-warning {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #F5F6F4;
        z-index: 999999;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    #landscape-warning .warning-content {
        max-width: 300px;
    }

    #landscape-warning .rotate-icon {
        margin-bottom: 20px;
        color: #4A5A52;
        animation: rotate-device 2s infinite ease-in-out;
    }

    #landscape-warning h3 {
        font-family: 'Playfair Display', serif;
        color: #2d3a35;
        font-size: 24px;
        margin-bottom: 10px;
    }

    #landscape-warning p {
        color: #546d63;
        font-size: 16px;
    }

    @keyframes rotate-device {
        0% { transform: rotate(0deg); }
        25% { transform: rotate(90deg); }
        50% { transform: rotate(90deg); }
        75% { transform: rotate(0deg); }
        100% { transform: rotate(0deg); }
    }
}

/* ============================================================
   Slumbelry P0 Fixes - Toast CSS - 2026-10-21
   ============================================================ */
.slumbelry-add-to-cart-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: #1a1a1a;
    color: #fff;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
    font-size: 14px;
    line-height: 1.4;
    max-width: 320px;
}
.slumbelry-add-to-cart-toast a {
    color: #fff;
    text-decoration: underline;
    margin-left: 8px;
}
.slumbelry-add-to-cart-toast a.button {
    background: #c8a96e;
    color: #1a1a1a;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    margin-top: 6px;
}
@media (max-width: 480px) {
    .slumbelry-add-to-cart-toast {
        left: 10px;
        right: 10px;
        bottom: 10px;
        text-align: center;
        max-width: none;
    }
    .slumbelry-add-to-cart-toast a {
        margin-left: 0;
        display: inline-block;
        margin: 4px 8px 0;
    }
}
