* { box-sizing: border-box; }
    body {
      margin: 0;
      background: #f7f7f5;
      color: #20372a;
      font-family: system-ui, sans-serif;
      line-height: 1.6;
    }
    .site-header {
      background: #000;
      color: white;
      padding: 20px 6%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 20px;
    }
    .site-header a { color: white; text-decoration: none; }
    main { max-width: 1200px; margin: auto; padding: 35px 6%; }
    #products {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
      gap: 24px;
    }
    article {
      background: white;
      border: 1px solid #dce3da;
      border-radius: 16px;
      overflow: hidden;
    }
    .product-content { padding: 22px; }
    .product-photo {
      width: 100%;
      height: 280px;
      object-fit: contain;
      display: block;
      background: #fff;
    }
    .photo-placeholder {
      min-height: 180px;
      display: grid;
      place-items: center;
      background: #e8ece5;
    }
    h2 { margin-top: 0; }
    .price { font-size: 23px; font-weight: 700; }
    select, button {
      padding: 10px 14px;
      border-radius: 7px;
      border: 1px solid #87988a;
      font: inherit;
    }
    article select { width: 100%; margin-top: 8px; }
    button { cursor: pointer; }
    :focus-visible { outline: 3px solid #c69332; outline-offset: 3px; }

    html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
    }

    .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: wrap;
    padding: 16px 6%;
    box-shadow: 0 2px 12px rgb(0 0 0 / 12%);
    }

    .site-header .brand {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.5px;
    }

    .site-header .brand__logo{
    height: 50%;
    max-height: 30px;
    width: auto;
    object-fit: contain;
    transition: transform .3s ease;
    }

    .header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    }

    #cart-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid rgb(255 255 255 / 30%);
    border-radius: 8px;
    }

    /* El icono permanece aunque JavaScript actualice el contador. */
    #cart-link::before {
    content: "";
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h2l2.4 12h11.2L21 7H6'/%3E%3Ccircle cx='9' cy='20' r='1'/%3E%3Ccircle cx='18' cy='20' r='1'/%3E%3C/svg%3E")
        center / contain no-repeat;
    }

    #cart-link:hover {
    background: rgb(255 255 255 / 10%);
    }

    #language {
    min-height: 44px;
    background: transparent;
    color: white;
    border-color: rgb(255 255 255 / 30%);
    }

    #cart,
    #checkout {
    margin-top: 36px;
    padding: clamp(20px, 4vw, 32px);
    background: white;
    border: 1px solid #dce3da;
    border-radius: 16px;
    }

    #cart-title,
    #checkout-title {
    margin-bottom: 20px;
    }

    #cart-total {
    font-size: 22px;
    font-weight: 700;
    }

    #cart-note {
    color: #526457;
    font-size: 14px;
    }

    #checkout-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    }

    #checkout-form > p {
    margin: 0;
    }

    #checkout-form label {
    display: grid;
    gap: 7px;
    font-weight: 600;
    }

    #checkout-form input,
    #checkout-form textarea {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #a7b4a8;
    border-radius: 8px;
    background: #fcfcf9;
    color: #20372a;
    font: inherit;
    }

    #checkout-form textarea {
    min-height: 100px;
    resize: vertical;
    }

    #checkout-form .full-width,
    #checkout-form .cf-turnstile,
    #checkout-form > button,
    #checkout-message {
    grid-column: 1 / -1;
    }

    #checkout-form > button {
    justify-self: start;
    min-height: 48px;
    padding: 12px 24px;
    background: #20372a;
    color: white;
    border-color: #20372a;
    font-weight: 600;
    }

    button:disabled {
    cursor: default;
    opacity: 0.6;
    }

    #checkout-message {
    overflow-wrap: anywhere;
    }

    @media (max-width: 600px) {
    .site-header {
        gap: 12px;
    }

    .brand {
        font-size: 19px;
    }

    .header-actions {
        gap: 8px;
    }

    #cart-link {
        padding: 8px;
        font-size: 14px;
    }

    #checkout-form {
        grid-template-columns: 1fr;
    }

    #checkout-form > button {
        width: 100%;
    }
    }

    @media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    }

    #cart-dialog {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(100%, 480px);
    height: 100dvh;
    max-width: 100%;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: #f5f5ef;
    color: #20372a;
    overflow-y: auto;
    overscroll-behavior: contain;
    }

    #cart-dialog::backdrop {
    background: rgb(0 0 0 / 45%);
    }

    body:has(#cart-dialog[open]) {
    overflow: hidden;
    }

    #cart-dialog #cart {
    margin: 0;
    padding: 24px;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    }

    .cart-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    }

    .cart-heading h2 {
    margin: 0;
    }

    #close-cart {
    background: white;
    color: #20372a;
    }

    #cart-items article {
    border-radius: 12px;
    }

    #cart-items h3 {
    margin-top: 0;
    }

    #cart-items input {
    padding: 8px;
    border: 1px solid #a7b4a8;
    border-radius: 6px;
    font: inherit;
    }

    #cart-checkout {
    width: 100%;
    margin-top: 16px;
    background: #20372a;
    color: white;
    font-weight: 600;
    }

    #cart-message:empty {
    display: none;
    }
