/* ============================================
   Grandsand - Matching Original Design
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-text-light: #777777;
    --color-text-muted: #999999;
    --color-link: #555555;
    --color-link-hover: #111111;
    --color-nav-bg: #f8f8f8;
    --color-nav-border: #e0e0e0;
    --color-border: #ddd;
    --color-border-light: #eee;
    --color-footer-bg: #ffffff;
    --font-logo: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Open Sans', 'Segoe UI', Arial, sans-serif;
    --max-width: 960px;
    --transition: 0.2s ease;
}

html {
    font-size: 14px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-link-hover);
}

/* --- Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Header --- */
.site-header {
    background: var(--color-surface);
    text-align: center;
    padding: 15px 0 0;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.header-tagline {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 5px;
    letter-spacing: 0.01em;
}

.lang-switch {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid var(--color-border);
    border-radius: 3px;
}

.lang-switch:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.logo {
    display: inline-block;
    text-decoration: none;
}

.logo-img {
    height: 120px;
    width: auto;
}

/* --- Navigation --- */
.main-nav {
    background: var(--color-surface);
}

.nav-inner {
    display: flex;
    align-items: center;
}

.nav-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-tabs > li {
    position: relative;
}

.nav-tabs > li > a,
.dropdown-toggle {
    display: block;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    transition: color var(--transition);
    white-space: nowrap;
}

.nav-tabs > li > a:hover,
.dropdown-toggle:hover {
    color: var(--color-text);
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 200px;
    padding: 5px 0;
    z-index: 200;
    list-style: none;
}

.has-dropdown.open .dropdown,
.has-dropdown:hover .dropdown {
    display: block;
}

.dropdown a {
    display: block;
    padding: 8px 20px;
    font-size: 0.85rem;
    color: var(--color-text);
}

.dropdown a:hover {
    background: var(--color-border-light);
    color: var(--color-link);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
}

/* --- Breadcrumb --- */
.breadcrumb-bar {
    background: var(--color-surface);
    padding: 8px 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.breadcrumb-bar a {
    color: var(--color-link);
}

.breadcrumb-bar .sep {
    margin: 0 4px;
    color: #ccc;
}

/* --- Main Content --- */
main {
    flex: 1;
    background: var(--color-surface);
    padding-bottom: 30px;
}

main > .container {
    padding-top: 25px;
}

main h1 {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-text);
}

/* --- Category Filter Pills --- */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.filter-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    color: var(--color-text-light);
    background: var(--color-surface);
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-nav-bg);
    color: var(--color-text);
    border-color: var(--color-nav-border);
}

/* --- Product Grid --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.product-grid-small {
    grid-template-columns: repeat(6, 1fr);
}

.product-card {
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    transition: opacity var(--transition);
}

.product-card:hover {
    opacity: 0.85;
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    text-align: center;
}

.product-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.product-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text);
}

/* --- Product Detail (3-column layout) --- */
.product-detail {
    display: grid;
    grid-template-columns: 300px 1fr 200px;
    gap: 25px;
    margin-bottom: 30px;
    align-items: start;
}

.product-detail-image {
    text-align: center;
}

.product-detail-image img {
    max-width: 100%;
    height: auto;
}

.product-detail-image a {
    display: block;
}

.product-detail-info {
    min-width: 0;
}

.product-detail-name {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.specs-table th,
.specs-table td {
    padding: 5px 8px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.specs-table th {
    font-weight: 600;
    color: var(--color-text-light);
    width: 45%;
    white-space: nowrap;
}

.specs-table td a {
    color: var(--color-link);
}

/* Price + SKU row */
.product-price-sku {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.product-detail-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
}

.product-sku-box {
    background: #f3f1ec;
    border: 1px solid var(--color-border-light);
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* Sidebar: similar products */
.product-sidebar {
    border-left: 1px solid var(--color-border-light);
    padding-left: 15px;
}

.sidebar-heading {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
    color: var(--color-text);
}

.sidebar-product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
    text-decoration: none;
    transition: opacity var(--transition);
}

.sidebar-product:hover {
    opacity: 0.8;
}

.sidebar-product img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-product-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text);
}

.sidebar-name {
    font-size: 0.75rem;
    color: var(--color-text-light);
    line-height: 1.3;
}

/* Related products section */
.related-products {
    margin-top: 30px;
    padding-top: 20px;
}

.related-products h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--color-text);
}

/* --- Content Pages --- */
.content-page {
    max-width: 700px;
}

.content-page h2 {
    font-size: 1.15rem;
    margin-top: 20px;
    margin-bottom: 8px;
}

.content-page h3 {
    font-size: 1rem;
    margin-top: 12px;
    margin-bottom: 5px;
}

.content-page p {
    margin-bottom: 10px;
    line-height: 1.65;
}

.content-page ul,
.content-page ol {
    margin-bottom: 10px;
    padding-left: 20px;
}

.content-page li {
    margin-bottom: 4px;
    line-height: 1.5;
}

/* --- Info Box --- */
.info-box {
    background: #f8f7f4;
    border: 1px solid var(--color-border-light);
    padding: 15px 20px;
    margin-top: 20px;
}

.info-box h2 {
    margin-top: 0;
}

/* --- Contact Form --- */
.contact-details {
    background: #f8f7f4;
    border: 1px solid var(--color-border-light);
    padding: 12px 15px;
    margin: 15px 0;
}

.contact-details p {
    margin-bottom: 4px;
}

.contact-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.form-group .required {
    color: #c00;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-link);
}

.btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--color-nav-border);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-primary {
    background: var(--color-nav-bg);
    color: var(--color-text);
}

.btn-primary:hover {
    background: #ddd9d0;
}

/* --- Alerts --- */
.alert {
    padding: 10px 12px;
    margin-bottom: 15px;
    border: 1px solid;
}

.alert-success {
    background: #edf7ed;
    border-color: #c8e6c9;
    color: #2d8a4e;
}

.alert-error {
    background: #fdecea;
    border-color: #f5c6cb;
    color: #c0392b;
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}

/* --- FAQ --- */
.faq-list {
    margin-top: 10px;
}

.faq-item {
    border: 1px solid var(--color-border-light);
    margin-bottom: 6px;
    background: var(--color-surface);
}

.faq-item summary {
    padding: 10px 12px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    transition: background var(--transition);
}

.faq-item summary:hover {
    background: #f8f7f4;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-left: 10px;
}

.faq-item[open] summary::after {
    content: '\2212';
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-answer {
    padding: 0 12px 12px;
    font-size: 0.9rem;
}

.faq-answer p {
    margin-bottom: 5px;
}

/* --- Sitemap --- */
.sitemap-list {
    list-style: none;
    padding-left: 0;
}

.sitemap-list > li {
    margin-bottom: 10px;
}

.sitemap-list > li > a {
    font-weight: 600;
}

.sitemap-list ul {
    margin-top: 4px;
    padding-left: 20px;
    list-style: disc;
}

.sitemap-list ul li {
    margin-bottom: 2px;
    font-size: 0.9rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-text-light);
    margin-top: auto;
    font-size: 0.85rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 25px 15px;
}

.footer-col h3 {
    color: var(--color-text);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 4px;
}

.footer-col a {
    color: var(--color-link);
}

.footer-col a:hover {
    color: var(--color-link-hover);
}

.footer-col p {
    line-height: 1.5;
}

.footer-bottom {
    padding: 12px 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.footer-bottom a {
    color: var(--color-text-muted);
}

.footer-bottom a:hover {
    color: var(--color-text);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .logo-img {
        height: 60px;
    }

    .menu-toggle {
        display: flex;
        padding: 10px 0;
    }

    .nav-tabs {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .nav-tabs.open {
        display: flex;
    }

    .nav-inner {
        flex-wrap: wrap;
    }

    .nav-tabs > li > a,
    .dropdown-toggle {
        padding: 10px 15px;
        width: 100%;
        text-align: left;
    }

    .dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 15px;
        background: #f8f8f8;
    }

    .product-detail {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .product-sidebar {
        grid-column: 1 / -1;
        border-left: none;
        border-top: 1px solid var(--color-border-light);
        padding-left: 0;
        padding-top: 15px;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .sidebar-heading {
        grid-column: 1 / -1;
    }

    .sidebar-product {
        flex-direction: column;
        text-align: center;
    }

    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .product-grid-small {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    main h1 {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .product-sidebar {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-grid-small {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-name {
        font-size: 0.7rem;
    }

    .category-filter {
        gap: 3px;
    }

    .filter-btn {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}
