@import 'https://unpkg.com/open-props@1.7.23/normalize.light.min.css' layer(base.normalize);
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;900&family=Raleway:wght@300;400;600&display=swap');
@import 'https://www.unpkg.com/layout-craft@0.1.1/dist/utilities.css' layer(design.utilities);
@import url('https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css');

@layer base.normalize-overrides {
  :root {
    --primary: #004483;
    --secondary: #005DA4;
    --brand: var(--primary);
    --nav-block-size: 4.625rem;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #333;
    
    /* Design System Typography and Spacing Variables */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Raleway', sans-serif;

    /* Accent Colors */
    --color-dark-bg: #2a2a2a;
    --color-light-bg: #ffffff;
    --color-cta-primary: #ff6633;  /* Coral Orange */
    --color-cta-hover: #ff5522;    /* Hover */
    
    font-family: var(--font-secondary), 'Inter', sans-serif;
  }

  body {
    -webkit-font-smoothing: antialiased;
    margin: 0;
    color: var(--text-color);
    background: #f8f9fa;
  }

  ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  figure {
    all: unset;
  }

  img {
    max-width: 100%;
    height: auto;
  }
}

@layer base.containers {
  .container {
    max-width: 1230px;
    margin-inline: auto;
    padding-inline: 1rem;
    width: 100%;
  }

  header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1100;
  }

  .Navbar {
    min-block-size: var(--nav-block-size);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .Menu {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0.6rem;

    @media (max-width: 1024px) {
      display: none !important;
    }

    @media (width >= 768px) {
      .NavIcon {
        display: none;
      }
    }

    @media (width < 768px) {
      .NavLink:hover {
        text-decoration: none;
      }
      .NavLinkTitle {
        display: none;
      }
    }
  }

  .NavItem {
    block-size: 100%;
    position: relative;
    display: flex;
    align-items: center;
  }

  .ItemContent {
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.08);
    inline-size: max(100%, 300px);
    position: absolute;
    top: calc(var(--nav-block-size) - 15px);
    opacity: 0;
    pointer-events: none;
    padding: 1rem;
    transition: all 0.3s ease;
    visibility: hidden;
    z-index: var(--layer-3);
    left: 50%;
    transform: translateX(-50%);

    ul {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
    }

    ul li {
      padding: 0;
      margin: 0;
    }

    ul li a {
      display: block;
      color: #353b3f !important;
      padding: 0.75rem 1rem;
      border-radius: 0.5rem;
      text-decoration: none;
      font-size: 0.95rem;
      font-weight: 500;
      transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
      text-align: left;
    }

    ul li:nth-child(1) a:hover {
      background-color: #65D076 !important;
      color: white !important;
      padding-left: 1.25rem;
    }
    ul li:nth-child(2) a:hover {
      background-color: #4B82FF !important;
      color: white !important;
      padding-left: 1.25rem;
    }
    ul li:nth-child(3) a:hover {
      background-color: #42B3DB !important;
      color: white !important;
      padding-left: 1.25rem;
    }
    ul li:nth-child(4) a:hover {
      background-color: #FA7E91 !important;
      color: white !important;
      padding-left: 1.25rem;
    }
    ul li:nth-child(5) a:hover {
      background-color: #A073FF !important;
      color: white !important;
      padding-left: 1.25rem;
    }
    ul li:nth-child(n+6) a:hover {
      background-color: var(--primary) !important;
      color: white !important;
      padding-left: 1.25rem;
    }

    .NavItem:hover & {
      visibility: visible;
      opacity: 1;
      top: var(--nav-block-size);
      pointer-events: all;
    }

    .NavItem:focus-within & {
      visibility: visible;
      opacity: 1;
      top: var(--nav-block-size);
      pointer-events: all;
    }
  }

  /* Dropdown arrow rotation on NavItem hover */
  .NavLink .dropdown-arrow {
    transition: transform 0.2s ease;
    display: inline-block;
  }

  .NavItem:hover .NavLink .dropdown-arrow {
    transform: rotate(180deg);
  }

  .glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  }

  footer {
    background: #333;
    color: #fff;
    padding: 3rem 0;
    margin-top: 5rem;
  }
}

@layer base.components {
  .Logo {
    text-decoration: none;
    h1 { margin: 0; font-size: 1.5rem; color: var(--primary); }
  }

  .NavLink {
    padding-inline: 0.75rem;
    padding-block: 0.5rem;
    border-radius: 8px;
    color: var(--text-color);
    background-color: inherit;
    font-size: var(--font-size-2);
    text-decoration-color: currentColor;
    font-weight: var(--font-weight-6);
    text-underline-offset: 1ex;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s, background-color 0.2s;

    @media (width > 1024px) {
      :is(.NavItem:focus-within, .NavItem:hover) & {
        color: var(--brand);
        background-color: rgba(0, 68, 131, 0.05);
      }
    }
  }

  .ButtonLink {
    color: white;
    background: var(--primary);
    font-size: var(--font-size-2);
    font-weight: var(--font-weight-6);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-2);
    text-decoration: none;
    transition: filter 0.2s ease;

    &:hover {
      filter: contrast(150%);
    }
  }

  .ItemTitle {
    color: var(--brand);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
  }

  .NavIcon {
    font-size: var(--font-size-5);
    font-weight: var(--font-weight-4);

    .NavLink:focus & {
      color: var(--brand);
    }
  }
}

/* Admin Form Styles */
.form-control { 
    width: 100%; 
    padding: 12px; 
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px; 
    box-sizing: border-box; 
    margin-bottom: 15px; 
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 68, 131, 0.1);
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #004483;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
}

/* Tabs Glider Menu */
.tabs-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 3rem auto;
    width: 100%;
}

.tabs {
    display: flex;
    position: relative;
    background-color: #fff;
    box-shadow: 0 0 1px 0 rgba(0, 68, 131, 0.15), 0 6px 12px 0 rgba(0, 68, 131, 0.15);
    padding: 0.5rem;
    border-radius: 99px;
    overflow: hidden;
}

.tabs * {
    z-index: 2;
}

.tabs input[type="radio"] {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 160px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 99px;
    cursor: pointer;
    transition: color 0.15s ease-in;
    color: #666;
    text-decoration: none;
}

.tabs input[type="radio"]:checked + .tab {
    color: #fff;
}

.glider {
    position: absolute;
    display: flex;
    height: 48px;
    width: 160px;
    background-color: var(--primary);
    z-index: 1;
    border-radius: 99px;
    transition: 0.25s ease-out;
}

/* Glider positions for up to 5 items */
#tab-1:checked ~ .glider { transform: translateX(0); }
#tab-2:checked ~ .glider { transform: translateX(160px); }
#tab-3:checked ~ .glider { transform: translateX(320px); }
#tab-4:checked ~ .glider { transform: translateX(480px); }
#tab-5:checked ~ .glider { transform: translateX(640px); }

@media (max-width: 800px) {
    .tabs-container {
        margin: 1.5rem auto !important;
    }
    .tabs {
        flex-direction: column;
        border-radius: 16px !important;
        width: 100%;
        max-width: 280px;
        padding: 0.4rem !important;
    }
    .tab {
        width: 100% !important;
        height: 40px !important;
        font-size: 0.9rem !important;
    }
    .glider {
        width: 100% !important;
        height: 40px !important;
    }
    #tab-1:checked ~ .glider { transform: translateY(0); }
    #tab-2:checked ~ .glider { transform: translateY(40px); }
    #tab-3:checked ~ .glider { transform: translateY(80px); }
    #tab-4:checked ~ .glider { transform: translateY(120px); }
    #tab-5:checked ~ .glider { transform: translateY(160px); }
}

/* ==========================================================================
   PAINT SHOP - DESIGN SYSTEM: RESPONSIVE & MOBILE DRAWER DEFINITIONS
   ========================================================================== */

/* Modern sliding drawer menu for mobile/tablet */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 310px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 25px rgba(0,0,0,0.15);
    z-index: 100000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.mobile-drawer.active {
    right: 0;
}

.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(1, 22, 39, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.drawer-link {
    transition: background 0.2s, color 0.2s;
}

.drawer-link:hover {
    background: #f7fafc;
    color: var(--primary) !important;
}

.drawer-collapse-btn {
    transition: background 0.2s;
}

.drawer-collapse-btn:hover {
    background: #f7fafc;
}

.drawer-submenu a {
    transition: color 0.2s, padding-left 0.2s;
}

.drawer-submenu a:hover {
    color: var(--primary) !important;
    padding-left: 5px;
}

/* Touch targets and Font Sizing legibility for Mobile Devices */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary), 'Inter', sans-serif !important;
}

body, p, a, label, span, button, input, td, select {
    font-family: var(--font-secondary), 'Inter', sans-serif !important;
}

/* Responsiveness overrides for larger screens vs smaller devices */
@media (max-width: 1024px) {
    .Navbar {
        padding-block: 0.75rem;
    }
    .hamburger-btn {
        display: flex !important;
    }
    .header-account-btn {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .top-bar {
        display: none !important; /* Hide tiny top bar to save vertical viewport space on mobile */
    }

    /* Shorter banner below menu for mobile version only */
    .home-hero {
        padding: 40px 15px !important;
    }
    .home-hero h1 {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }
    .home-hero p {
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }
    .home-hero .btn-primary {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.85rem !important;
    }
}

/* Responsive Product Grid & Card Optimizations */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .product-grid .glass-card {
        padding: 10px !important;
        border-radius: 12px !important;
        gap: 10px !important;
    }

    .product-grid .glass-card img {
        border-radius: 8px !important;
    }

    .product-grid .glass-card .btn-primary {
        padding: 8px 6px !important;
        font-size: 0.82rem !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 6px !important;
        margin-top: 5px !important;
    }

    .product-grid .glass-card a {
        font-size: 0.88rem !important;
        line-height: 1.3 !important;
    }
    
    .product-grid .glass-card p {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
    }
}

/* Store layout responsive sidebar */
@media (max-width: 768px) {
    .store-layout {
        flex-direction: column !important;
    }
    .store-layout aside {
        width: 100% !important;
        margin-bottom: 30px;
    }
}
