/*
Theme Name: Pimp My Tesla — Shop
Theme URI: https://shop.pimpmytesla.it
Description: WooCommerce shop theme for Pimp My Tesla accessories and parts.
Version: 1.0.0
Author: Pimp My Tesla
Text Domain: pimp-shop
*/

/* ─── WooCommerce Product Grid ───────────────────────────────────────────── */

.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (max-width: 1024px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}

/* Card */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    padding: 0 !important;
    margin-bottom: 0 !important;
    float: none !important;
    width: auto !important;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 10px 32px rgba(50,43,128,0.14);
    transform: translateY(-4px);
}

/* Product image */
.woocommerce ul.products li.product a img {
    width: 100% !important;
    height: 220px !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: block !important;
    transition: transform 0.4s ease !important;
}

.woocommerce ul.products li.product:hover a img {
    transform: scale(1.04) !important;
}

/* Product title */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #322B80 !important;
    padding: 0.875rem 1rem 0.25rem !important;
    margin: 0 !important;
    line-height: 1.35 !important;
}

/* Price */
.woocommerce ul.products li.product .price {
    color: #C3007A !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    padding: 0 1rem 0.5rem !important;
    display: block;
}

.woocommerce ul.products li.product .price del {
    color: #aaa !important;
    font-size: 0.85rem;
    font-weight: 400;
}

/* Add to cart button */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.button {
    display: block !important;
    margin: 0.5rem 1rem 1rem !important;
    background-color: #C3007A !important;
    color: white !important;
    text-align: center !important;
    padding: 0.7rem 1rem !important;
    border-radius: 8px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    transition: background-color 0.25s ease !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product a.button:hover {
    background-color: #a00063 !important;
    color: white !important;
    transform: none !important;
}

/* Sale badge */
.woocommerce span.onsale {
    background-color: #C3007A !important;
    border-radius: 6px !important;
    min-height: auto !important;
    padding: 4px 10px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    min-width: auto !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
}

/* ─── Single Product ─────────────────────────────────────────────────────── */

.woocommerce div.product .product_title {
    font-family: 'Inter', sans-serif !important;
    color: #322B80 !important;
    font-weight: 900 !important;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: #C3007A !important;
    font-weight: 700 !important;
    font-size: 1.6rem !important;
}

.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
    font-size: 1rem !important;
    color: #aaa !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
    background-color: #C3007A !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 1rem 2.5rem !important;
    border: none !important;
    transition: background-color 0.25s ease !important;
    font-family: 'Inter', sans-serif !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
    background-color: #a00063 !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
    color: #322B80 !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    color: #555 !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
}

/* ─── Quantity ───────────────────────────────────────────────────────────── */

.woocommerce .quantity .qty,
.woocommerce div.product form.cart div.quantity .qty {
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    color: #322B80 !important;
}

/* ─── Cart / Checkout buttons ────────────────────────────────────────────── */

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background-color: #322B80 !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-family: 'Inter', sans-serif !important;
    transition: background-color 0.25s ease !important;
    border: none !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background-color: #252060 !important;
    color: white !important;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #payment #place_order,
.woocommerce-page #payment #place_order {
    background-color: #C3007A !important;
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce #payment #place_order:hover,
.woocommerce-page #payment #place_order:hover {
    background-color: #a00063 !important;
}

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */

.woocommerce .woocommerce-breadcrumb {
    color: #9ca3af !important;
    font-size: 0.875rem !important;
    margin-bottom: 2rem !important;
    font-family: 'Inter', sans-serif !important;
}

.woocommerce .woocommerce-breadcrumb a {
    color: #322B80 !important;
    text-decoration: none !important;
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    color: #322B80 !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

.woocommerce nav.woocommerce-pagination ul li a:focus,
.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li span.current {
    background: #322B80 !important;
    color: white !important;
}

/* ─── Notices ────────────────────────────────────────────────────────────── */

.woocommerce-message { border-top-color: #C3007A !important; }
.woocommerce-message::before { color: #C3007A !important; }
.woocommerce-error { border-top-color: #dc2626 !important; }
.woocommerce-info { border-top-color: #322B80 !important; }
.woocommerce-info::before { color: #322B80 !important; }

/* ─── Cart Sidebar ───────────────────────────────────────────────────────── */

#cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#cart-overlay.open { opacity: 1; pointer-events: auto; }

#cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 380px;
    max-width: 92vw;
    background: white;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 32px rgba(0,0,0,0.16);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#cart-sidebar.open { transform: translateX(0); }

.cart-sidebar-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.cart-sidebar-hd h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    color: #322B80;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

.cart-sidebar-hd #cart-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #555;
    transition: background 0.2s, color 0.2s;
}

.cart-sidebar-hd #cart-close:hover { background: #C3007A; color: white; }

.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

/* Mini cart items */
.woocommerce-mini-cart.cart_list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-mini-cart-item.mini_cart_item {
    display: flex !important;
    align-items: center !important;
    gap: 0.875rem !important;
    padding: 0.875rem 1.5rem !important;
    border-bottom: 1px solid #f9fafb !important;
}

.woocommerce-mini-cart-item img {
    width: 68px !important;
    height: 68px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
}

.woocommerce-mini-cart-item a:not(.remove_from_cart_button) {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    color: #322B80 !important;
    text-decoration: none !important;
    font-size: 0.875rem !important;
    line-height: 1.35 !important;
    display: block;
}

.woocommerce-mini-cart-item .quantity {
    font-size: 0.8rem !important;
    color: #888 !important;
    margin-top: 0.2rem !important;
    font-family: 'Inter', sans-serif !important;
}

.woocommerce-mini-cart-item .woocommerce-Price-amount {
    color: #C3007A !important;
    font-weight: 700 !important;
}

.woocommerce-mini-cart-item a.remove_from_cart_button {
    color: #ccc !important;
    font-size: 1.1rem !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

.woocommerce-mini-cart-item a.remove_from_cart_button:hover { color: #C3007A !important; }

.woocommerce-mini-cart__empty-message {
    text-align: center;
    color: #9ca3af;
    padding: 3rem 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

/* Sidebar footer: total + buttons */
.woocommerce-mini-cart__total {
    display: flex !important;
    justify-content: space-between !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    color: #322B80 !important;
    font-size: 1rem !important;
    padding: 1.25rem 1.5rem 0.75rem !important;
    border-top: 2px solid #f3f4f6 !important;
}

.woocommerce-mini-cart__total .woocommerce-Price-amount {
    color: #C3007A !important;
    font-size: 1.1rem !important;
}

.woocommerce-mini-cart__buttons.buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0 1.5rem 1.5rem !important;
}

.woocommerce-mini-cart__buttons a {
    display: block !important;
    text-align: center !important;
    padding: 0.875rem !important;
    border-radius: 8px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    text-decoration: none !important;
    transition: background-color 0.25s ease !important;
}

.woocommerce-mini-cart__buttons a.wc-forward:not(.checkout) {
    background: #f3f4f6 !important;
    color: #322B80 !important;
}

.woocommerce-mini-cart__buttons a.wc-forward:not(.checkout):hover { background: #e5e7eb !important; }

.woocommerce-mini-cart__buttons a.checkout {
    background: #C3007A !important;
    color: white !important;
}

.woocommerce-mini-cart__buttons a.checkout:hover { background: #a00063 !important; }

/* ─── Search Overlay ─────────────────────────────────────────────────────── */

#search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(50,43,128,0.97);
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#search-overlay.open { opacity: 1; pointer-events: auto; }

#search-overlay form {
    width: 100%;
    max-width: 640px;
    padding: 0 1.5rem;
    position: relative;
}

#search-overlay input[type="search"] {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 1.75rem;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    padding: 1rem 3.5rem 1rem 0;
    outline: none;
    caret-color: #C3007A;
}

#search-overlay input[type="search"]::placeholder { color: rgba(255,255,255,0.35); }

#search-overlay button[type="submit"] {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#search-overlay button[type="submit"]:hover { opacity: 1; }

#search-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    line-height: 1;
}

#search-close:hover { opacity: 1; }

/* ─── Primary Nav Menu ───────────────────────────────────────────────────── */

.primary-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-nav > li > a {
    display: block;
    padding: 0.875rem 1.125rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: white;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}

.primary-nav > li > a:hover,
.primary-nav > li.current-menu-item > a,
.primary-nav > li.current-menu-ancestor > a {
    color: #C3007A;
    background-color: rgba(255,255,255,0.06);
}

/* Dropdown */
.primary-nav > li { position: relative; }

.primary-nav > li > ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 210px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    border-radius: 0 0 10px 10px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
}

.primary-nav > li:hover > ul { opacity: 1; pointer-events: auto; transform: translateY(0); }

.primary-nav > li > ul > li > a {
    display: block;
    padding: 0.625rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}

.primary-nav > li > ul > li > a:hover { color: #C3007A; background-color: #fafafa; }

/* Mobile nav */
#mobile-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-nav.open { max-height: 600px; }

.mobile-nav-list { list-style: none; padding: 0; margin: 0; }

.mobile-nav-list > li > a {
    display: block;
    padding: 0.875rem 1.25rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #322B80;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: color 0.2s;
}

.mobile-nav-list > li > a:hover { color: #C3007A; }

/* Mobile hamburger */
.hamburger-btn { width: 26px; height: 18px; position: relative; cursor: pointer; }
.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #322B80;
    border-radius: 2px;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}
.hamburger-btn span:nth-child(1) { top: 0; }
.hamburger-btn span:nth-child(2) { top: 8px; }
.hamburger-btn span:nth-child(3) { top: 16px; }
.hamburger-btn.open span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; transform: translateX(6px); }
.hamburger-btn.open span:nth-child(3) { top: 8px; transform: rotate(-45deg); }
